using System.Collections; class SomeObj { id : int; public override GetHashCode () : int { id } public override Equals (other : object) : bool { other == this } static mutable cid : int; public this () { id = cid; cid++; } } module M { mutable cnt : int; mutable ar : array [SomeObj]; mutable ht : Hashtable; test_ht () : void { ht = Hashtable (); ht.Clear (); ht [ar[1]] = ht; ht [ar[3]] = ht; ht [ar[7]] = ht; ht [ar[4]] = ht; for (mutable i = 0; i < 10; ++i) when (ht.Contains (ar[i])) ++cnt; } public Main () : void { ht = Hashtable (); ar = array(20); for (mutable i = 0; i < 10; ++i) ar[i] = SomeObj(); for (mutable i = 0; i < 1000000; ++i) test_ht (); System.Console.WriteLine (cnt); } }