Don't use System.Environment.Exit to finish a sdb session on iOS.
[mono.git] / mono / mini / generics.cs
index 4c23b39a7c7b2d1d6838e2a88be918d366d464fd..19282df514e273e5f2da45e6208e835255b34b58 100644 (file)
@@ -941,4 +941,43 @@ class Tests {
 
                return 0;
        }
+
+       struct Record : Foo2<Record>.IRecord {
+               int counter;
+               int Foo2<Record>.IRecord.DoSomething () {
+                       return counter++;
+               }
+       }
+
+       class Foo2<T> where T : Foo2<T>.IRecord {
+               public interface IRecord {
+                       int DoSomething ();
+               }
+
+               public static int Extract (T[] t) {
+                       return t[0].DoSomething ();
+               }
+       }
+
+       class Foo3<T> where T : IComparable {
+               public static int CompareTo (T[] t) {
+                       // This is a constrained call to Enum.CompareTo ()
+                       return t[0].CompareTo (t [0]);
+               }
+       }
+
+       public static int test_1_regress_constrained_iface_call_7571 () {
+        var r = new Record [10];
+        Foo2<Record>.Extract (r);
+               return Foo2<Record>.Extract (r);
+       }
+
+       enum ConstrainedEnum {
+               Val = 1
+       }
+
+       public static int test_0_regress_constrained_iface_call_enum () {
+               var r = new ConstrainedEnum [10];
+               return Foo3<ConstrainedEnum>.CompareTo (r);
+       }
 }