We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1161c83 commit fd41fe7Copy full SHA for fd41fe7
1 file changed
Naggum.Runtime/Symbol.cs
@@ -16,15 +16,36 @@ public Symbol(String aName)
16
17
bool IEquatable<Symbol>.Equals(Symbol other)
18
{
19
- return Name.Equals(other.Name);
+ return AreEqual(this, other);
20
}
21
22
+ public override bool Equals(object obj)
23
+ {
24
+ var symbol = obj as Symbol;
25
+ if (symbol != null)
26
27
+ return AreEqual(this, symbol);
28
+ }
29
+
30
+ return false;
31
32
33
+ public override int GetHashCode()
34
35
+ return Name.GetHashCode();
36
37
38
/// <summary>
39
/// </summary>
40
/// <returns>Returns symbol's name as string.</returns>
41
public override string ToString()
42
43
return Name;
44
45
46
+ private static bool AreEqual(Symbol one, Symbol other)
47
48
+ return one.Name.Equals(other.Name);
49
50
51
0 commit comments