+2008-12-11 Mark Probst <mark.probst@gmail.com>
+
+ * metadata/generic-sharing.c: Look for constraints in all type
+ arguments, not just the first one.
2008-12-10 Gonzalo Paniagua Javier <gonzalo@novell.com>
return FALSE;
}
+static gboolean
+has_constraints (MonoGenericContainer *container)
+{
+ int i;
+
+ g_assert (container->type_argc > 0);
+ g_assert (container->type_params);
+
+ for (i = 0; i < container->type_argc; ++i)
+ if (container->type_params [i].constraints)
+ return TRUE;
+ return FALSE;
+}
+
/*
* mono_method_is_generic_sharable_impl:
* @method: a method
g_assert (inflated->declaring);
if (inflated->declaring->is_generic) {
- g_assert (mono_method_get_generic_container (inflated->declaring)->type_params);
-
- if (mono_method_get_generic_container (inflated->declaring)->type_params->constraints)
+ if (has_constraints (mono_method_get_generic_container (inflated->declaring)))
return FALSE;
}
}
return FALSE;
g_assert (method->klass->generic_class->container_class &&
- method->klass->generic_class->container_class->generic_container &&
- method->klass->generic_class->container_class->generic_container->type_params);
+ method->klass->generic_class->container_class->generic_container);
- if (method->klass->generic_class->container_class->generic_container->type_params->constraints)
+ if (has_constraints (method->klass->generic_class->container_class->generic_container))
return FALSE;
}
+2008-12-11 Mark Probst <mark.probst@gmail.com>
+
+ * method-to-ir.c: Removed an unnecessary assertion.
+
2008-12-10 Zoltan Varga <vargaz@gmail.com>
* method-to-ir.c: Merge SGEN changes from the old JIT.
!mono_class_generic_sharing_enabled (cmethod->klass))) {
MonoInst *cmethod_addr;
- g_assert (!callvirt_this_arg);
-
cmethod_addr = emit_get_rgctx_method (cfg, context_used,
cmethod, MONO_RGCTX_INFO_GENERIC_METHOD_CODE);
+2008-12-11 Mark Probst <mark.probst@gmail.com>
+
+ * generic-marshalbyref.2.cs: Test for calls to marshal-by-ref
+ objects.
+
+ * Makefile.am: Test added.
+
2008-12-08 Rodrigo Kumpera <rkumpera@novell.com>
* bug445361.il: New regression test.
generic-delegate-ctor.2.cs \
generic-array-iface-set.2.cs \
generic-typedef.2.cs \
+ generic-marshalbyref.2.cs \
bug-431413.2.cs \
generic-virtual-invoke.2.cs \
recursive-generics.2.cs \
generic-getgenericarguments.2.exe generic-type-builder.2.exe \
generic-synchronized.2.exe generic-delegate-ctor.2.exe \
generic-constrained.2.exe bug-431413.2.exe \
- generic-virtual-invoke.2.exe generic-typedef.2.exe
+ generic-virtual-invoke.2.exe generic-typedef.2.exe \
+ generic-marshalbyref.2.exe
@for fn in $+ ; do \
echo "Testing $$fn ..."; \
MONO_GENERIC_SHARING=all $(RUNTIME) -O=gshared $$fn > $$fn.stdout || exit 1; \
--- /dev/null
+using System;
+
+static class Program
+{
+ static int Main()
+ {
+ DocumentForm<object> browseForm = new DocumentForm<object> ();
+ if (browseForm.DoInit () != 124)
+ return 1;
+ return 0;
+ }
+}
+
+public abstract class EntityBase
+{
+}
+
+public class GenEntity<T> : EntityBase
+{
+}
+
+class DocumentForm<T>
+{
+ internal int DoInit()
+ {
+ var g = new Grid1<GenEntity<T>>(123);
+ return g.num;
+ }
+}
+
+public class Grid1<TEntity> : MarshalByRefObject where TEntity : EntityBase, new()
+{
+ public int num;
+
+ public Grid1 (int i)
+ {
+ num = i + 1;
+ }
+}