File tree Expand file tree Collapse file tree 2 files changed +11
-11
lines changed
src/Domain/HydraScript.Domain.IR Expand file tree Collapse file tree 2 files changed +11
-11
lines changed Original file line number Diff line number Diff line change 1+ namespace HydraScript . Domain . IR ;
2+
3+ public interface ISymbolId < out TSymbol > : IEquatable < ISymbolId < ISymbol > >
4+ where TSymbol : class , ISymbol ;
Original file line number Diff line number Diff line change 11namespace HydraScript . Domain . IR ;
22
3- public abstract class SymbolId : IEquatable < SymbolId >
3+ public abstract class SymbolId < TSymbol > : ISymbolId < TSymbol >
4+ where TSymbol : class , ISymbol
45{
56 protected abstract string Value { get ; }
67
7- public bool Equals ( SymbolId ? other )
8- {
9- if ( other is null ) return false ;
10- if ( ReferenceEquals ( this , other ) ) return true ;
11- return Value == other . Value ;
12- }
8+ public bool Equals ( ISymbolId < ISymbol > ? other ) =>
9+ Value == other ? . ToString ( ) ;
1310
1411 public override bool Equals ( object ? obj )
1512 {
16- if ( obj is null ) return false ;
17- if ( ReferenceEquals ( this , obj ) ) return true ;
18- if ( obj . GetType ( ) != GetType ( ) ) return false ;
19- return Equals ( ( SymbolId ) obj ) ;
13+ if ( obj is ISymbolId < ISymbol > other )
14+ return Equals ( other ) ;
15+ return false ;
2016 }
2117
2218 public override int GetHashCode ( ) => Value . GetHashCode ( ) ;
You can’t perform that action at this time.
0 commit comments