X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=mono%2Fmini%2Fgenerics.cs;h=19282df514e273e5f2da45e6208e835255b34b58;hb=6b104c2bc41fe0e94488f0ef461319cb3a512aa3;hp=4c23b39a7c7b2d1d6838e2a88be918d366d464fd;hpb=8f59998c4f744c7b78cf6cdd7f5849f99902c4b8;p=mono.git diff --git a/mono/mini/generics.cs b/mono/mini/generics.cs index 4c23b39a7c7..19282df514e 100644 --- a/mono/mini/generics.cs +++ b/mono/mini/generics.cs @@ -941,4 +941,43 @@ class Tests { return 0; } + + struct Record : Foo2.IRecord { + int counter; + int Foo2.IRecord.DoSomething () { + return counter++; + } + } + + class Foo2 where T : Foo2.IRecord { + public interface IRecord { + int DoSomething (); + } + + public static int Extract (T[] t) { + return t[0].DoSomething (); + } + } + + class Foo3 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.Extract (r); + return Foo2.Extract (r); + } + + enum ConstrainedEnum { + Val = 1 + } + + public static int test_0_regress_constrained_iface_call_enum () { + var r = new ConstrainedEnum [10]; + return Foo3.CompareTo (r); + } }