+2009-10-06 Zoltan Varga <vargaz@gmail.com>
+
+ * aot-compiler.c (add_generic_class): Add an instance of GenericComparer<T> for
+ each instance of Comparer<T>.
+
+ * generics.cs: Add a new test.
+
2009-10-04 Zoltan Varga <vargaz@gmail.com>
* aot-compiler.c (add_generic_class): Only add GetGenericValueImpl wrappers
add_extra_method (acfg, mono_marshal_get_native_wrapper (mono_class_inflate_generic_method (get_method, &ctx), TRUE, TRUE));
}
}
+ }
+
+ /* Add an instance of GenericComparer<T> which is created dynamically by Comparer<T> */
+ if (klass->image == mono_defaults.corlib && !strcmp (klass->name_space, "System.Collections.Generic") && !strcmp (klass->name, "Comparer`1")) {
+ MonoClass *tclass = mono_class_from_mono_type (klass->generic_class->context.class_inst->type_argv [0]);
+ MonoClass *icomparable, *gcomparer;
+ MonoGenericContext ctx;
+ MonoType *args [16];
+ memset (&ctx, 0, sizeof (ctx));
+
+ icomparable = mono_class_from_name (mono_defaults.corlib, "System", "IComparable`1");
+ g_assert (icomparable);
+ args [0] = &tclass->byval_arg;
+ ctx.class_inst = mono_metadata_get_generic_inst (1, args);
+
+ if (mono_class_is_assignable_from (mono_class_inflate_generic_class (icomparable, &ctx), tclass)) {
+ gcomparer = mono_class_from_name (mono_defaults.corlib, "System.Collections.Generic", "GenericComparer`1");
+ g_assert (gcomparer);
+ add_generic_class (acfg, mono_class_inflate_generic_class (gcomparer, &ctx));
+ }
}
}
return filteredWords.Count ();
}
+ public static int test_0_fullaot_comparer_t () {
+ var l = new SortedList <TimeSpan, int> ();
+ return l.Count;
+ }
+
static int cctor_count = 0;
public abstract class Beta<TChanged>