}
}
+ 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);
+ }
}
if (slot == -1)
TYPE_LOAD_ERROR (cmethod->klass);
cmethod = constrained_call->vtable [ioffset + slot];
+
+ if (cmethod->klass == mono_defaults.enum_class) {
+ /* Enum implements some interfaces, so treat this as the first case */
+ EMIT_NEW_LOAD_MEMBASE_TYPE (cfg, ins, &constrained_call->byval_arg, sp [0]->dreg, 0);
+ ins->klass = constrained_call;
+ sp [0] = handle_box (cfg, ins, constrained_call, mono_class_check_context_used (constrained_call));
+ CHECK_CFG_EXCEPTION;
+ }
}
virtual = 0;
}