Delete executable bit.
[mono.git] / mcs / tests / test-28.cs
index 3dc65d776bd5c0444065c24649eece36cae1b7aa..ee1c7e5675745e113c0d702ab813a31f6f1e914c 100644 (file)
@@ -1,5 +1,11 @@
+using System.Collections;
 abstract class A {
-        protected abstract int this [int a] { get; } 
+        protected abstract int this [int a] { get; }
+
+       public int EmulateIndexer (int a)
+       {
+               return this [a];
+       }
 }
 
 class B : A {
@@ -33,7 +39,6 @@ class X {
        static int Main ()
        {
                X x = new X ();
-               int b;
 
                x [0] = 1;
                if (x.v1 != 1)
@@ -42,6 +47,18 @@ class X {
                if (x [0] != 1)
                        return 2;
 
+               B bb = new B ();
+
+               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 ();
        }
 }