Author: lupus
Date: 2007-10-06 03:48:19 -0400 (Sat, 06 Oct 2007)
New Revision: 87028

Modified:
   trunk/mono/mono/metadata/ChangeLog
   trunk/mono/mono/metadata/class.c
Log:


Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>

        * class.c: the valuetype enumerators don't have the additional
        supertypes interfaces.



Modified: trunk/mono/mono/metadata/ChangeLog
===================================================================
--- trunk/mono/mono/metadata/ChangeLog  2007-10-06 07:35:22 UTC (rev 87027)
+++ trunk/mono/mono/metadata/ChangeLog  2007-10-06 07:48:19 UTC (rev 87028)
@@ -1,4 +1,9 @@
 
+Sat Oct 6 10:01:42 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
+
+       * class.c: the valuetype enumerators don't have the additional
+       supertypes interfaces.
+
 Fri Oct 5 20:33:31 CEST 2007 Paolo Molaro <[EMAIL PROTECTED]>
 
        * class.c: need more interfaces setup for the IEnumerator<T>

Modified: trunk/mono/mono/metadata/class.c
===================================================================
--- trunk/mono/mono/metadata/class.c    2007-10-06 07:35:22 UTC (rev 87027)
+++ trunk/mono/mono/metadata/class.c    2007-10-06 07:48:19 UTC (rev 87028)
@@ -1772,12 +1772,14 @@
        int i, interface_count, real_count;
        int all_interfaces;
        gboolean internal_enumerator;
+       gboolean eclass_is_valuetype;
 
        if (!mono_defaults.generic_ilist_class) {
                *num = 0;
                return NULL;
        }
        internal_enumerator = FALSE;
+       eclass_is_valuetype = FALSE;
        if (class->byval_arg.type != MONO_TYPE_SZARRAY) {
                if (class->generic_class && class->nested_in == 
mono_defaults.array_class && strcmp (class->name, "InternalEnumerator`1") == 0) 
 {
                        /*
@@ -1842,6 +1844,7 @@
                real_count = interface_count = 3;
                interfaces = g_malloc0 (sizeof (MonoClass*) * interface_count);
                interfaces [0] = fclass;
+               eclass_is_valuetype = TRUE;
        } else {
                int j;
                int idepth = eclass->idepth;
@@ -1917,14 +1920,16 @@
                                generic_ienumerator_class, 1, args, FALSE);
                        /*g_print ("%s implements %s\n", class->name, 
mono_type_get_name_full (&interfaces [i]->byval_arg, 0));*/
                }
-               j = interface_count;
-               for (i = 0; i < eclass->idepth; i++) {
-                       MonoType *args [1];
-                       args [0] = &eclass->supertypes [i]->byval_arg;
-                       interfaces [j] = mono_class_bind_generic_parameters (
-                               generic_ienumerator_class, 1, args, FALSE);
-                       /*g_print ("%s implements %s\n", class->name, 
mono_type_get_name_full (&interfaces [i]->byval_arg, 0));*/
-                       j ++;
+               if (!eclass_is_valuetype) {
+                       j = interface_count;
+                       for (i = 0; i < eclass->idepth; i++) {
+                               MonoType *args [1];
+                               args [0] = &eclass->supertypes [i]->byval_arg;
+                               interfaces [j] = 
mono_class_bind_generic_parameters (
+                                       generic_ienumerator_class, 1, args, 
FALSE);
+                               /*g_print ("%s implements %s\n", class->name, 
mono_type_get_name_full (&interfaces [i]->byval_arg, 0));*/
+                               j ++;
+                       }
                }
        }
        *num = real_count;

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to