+2010-01-07 Rodrigo Kumpera <rkumpera@novell.com>
+
+ * object.c:
+ * icall.c:
+ * class.c: Add some FIXME for due to variant generic arguments.
+
+ object.c (mono_object_isinst_mbyref): Interfaces with variant generic arguments
+ can't use the simple bitfield check, so call mono_class_is_assignable_from if
+ the bitfield check fails.
+
2010-01-07 Rodrigo Kumpera <rkumpera@novell.com>
* class.c (mono_class_is_assignable_from): Rework the generics variance code
return class;
}
+/*FIXME test for interfaces with variant generic arguments*/
gboolean
mono_class_is_subclass_of (MonoClass *klass, MonoClass *klassc,
gboolean check_interfaces)
mono_class_setup_vtable (class);
/* type doesn't implement iface: the exception is thrown in managed code */
+ /*FIXME test for interfaces with variant generic arguments*/
if (! MONO_CLASS_IMPLEMENTS_INTERFACE (class, iclass->interface_id))
return;
GPtrArray *ifaces;
int method_count;
+ /*FIXME test for interfaces with variant generic arguments*/
if (MONO_CLASS_IMPLEMENTS_INTERFACE (class, iclass->interface_id))
continue; /* interface implemented by the class */
if (g_slist_find (extra_interfaces, iclass))
if (ifaces) {
for (i = 0; i < ifaces->len; ++i) {
MonoClass *ic = g_ptr_array_index (ifaces, i);
+ /*FIXME test for interfaces with variant generic arguments*/
if (MONO_CLASS_IMPLEMENTS_INTERFACE (class, ic->interface_id))
continue; /* interface implemented by the class */
if (g_slist_find (extra_interfaces, ic))
if (!klass->inited)
mono_class_init (klass);
- if (klass->marshalbyref || klass->flags & TYPE_ATTRIBUTE_INTERFACE)
+ if (klass->marshalbyref || (klass->flags & TYPE_ATTRIBUTE_INTERFACE))
return mono_object_isinst_mbyref (obj, klass);
if (!obj)
if (MONO_VTABLE_IMPLEMENTS_INTERFACE (vt, klass->interface_id)) {
return obj;
}
+
+ /*If the above check fails we are in the slow path of possibly raising an exception. So it's ok to it this way.*/
+ if (mono_class_has_variant_generic_params (klass) && mono_class_is_assignable_from (klass, obj->vtable->klass))
+ return obj;
} else {
MonoClass *oklass = vt->klass;
if ((oklass == mono_defaults.transparent_proxy_class))