@@ -77,4 +77,18 @@ package cs.internal;
{
return Runtime.callField(obj, field, hash, dynArgs);
}
+
+ public function Equals(obj:Dynamic):Bool
+ {
+ if (obj == null)
+ return false;
+ var c:Closure = cast obj;
+ return (c.obj == this.obj && c.field == this.field);
+ }
+ public function GetHashCode():Int
+ return obj.GetHashCode() ^ untyped field.GetHashCode();
@@ -77,4 +77,18 @@ import java.internal.Runtime;
return Runtime.callField(obj, field, dynArgs);
-}
+ public function equals(obj:Dynamic):Bool
+ public function hashCode():Int
+ return obj.hashCode() ^ untyped field.hashCode();
+}
@@ -0,0 +1,12 @@
+package unit.issues;
+class Issue3771 extends Test
+{
+ public function test()
+#if cs
+ var arr = [test];
+ eq(arr.indexOf(test),0);
+#end