Improve test
[mono.git] / mcs / tests / test-28.cs
index 50f7dbb02bf03d08d427dbee60da9280a2f46538..ee1c7e5675745e113c0d702ab813a31f6f1e914c 100644 (file)
@@ -1,3 +1,4 @@
+using System.Collections;
 abstract class A {
         protected abstract int this [int a] { get; }
 
@@ -51,6 +52,13 @@ class X {
                if (bb.EmulateIndexer (10) != 10)
                        return 3;
 
+               //
+               // This tests that we properly set the return type for the setter
+               // use pattern in the following indexer (see bug 36156)
+               Hashtable a = new Hashtable ();
+               int b = (int) (a [0] = 1);
+               if (b != 1)
+                       return 4;
                return new B ().M ();
        }
 }