summaryrefslogtreecommitdiff
path: root/Source/Core/AbsyExpr.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/AbsyExpr.cs')
-rw-r--r--Source/Core/AbsyExpr.cs8
1 files changed, 6 insertions, 2 deletions
diff --git a/Source/Core/AbsyExpr.cs b/Source/Core/AbsyExpr.cs
index 7e71453b..33b3a818 100644
--- a/Source/Core/AbsyExpr.cs
+++ b/Source/Core/AbsyExpr.cs
@@ -2122,12 +2122,16 @@ namespace Microsoft.Boogie {
return false;
NAryExpr other = (NAryExpr)obj;
- return this.Args.ListEquals(other.Args) && object.Equals(this.Fun, other.Fun);
+ return object.Equals(this.Fun, other.Fun) && this.Args.SequenceEqual(other.Args);
}
[Pure]
public override int GetHashCode() {
int h = this.Fun.GetHashCode();
- h ^= this.Args.GetHashCode();
+ // DO NOT USE Args.GetHashCode() because that uses Object.GetHashCode() which uses references
+ // We want structural equality
+ foreach (var arg in Args) {
+ h = (97*h) + arg.GetHashCode();
+ }
return h;
}
public override void Emit(TokenTextWriter stream, int contextBindingStrength, bool fragileContext) {