2006-09-05 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Wed, 6 Sep 2006 02:00:31 +0000 (02:00 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Wed, 6 Sep 2006 02:00:31 +0000 (02:00 -0000)
* TypeBuilder.cs (SetParent): Null parent is allowed for
interfaces. .   This was exposed by the VB compiler

svn path=/trunk/mcs/; revision=64981

mcs/class/corlib/System.Reflection.Emit/ChangeLog
mcs/class/corlib/System.Reflection.Emit/TypeBuilder.cs

index d0622aefa43b35849659593a0a77f74eda43e9a4..65c428e8b647f440156b36516a9a7bfa9e98e6c2 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-05  Miguel de Icaza  <miguel@novell.com>
+
+       * TypeBuilder.cs (SetParent): Null parent is allowed for
+       interfaces. 
+
 2006-09-02  Zoltan Varga  <vargaz@gmail.com>
 
        * DynamicMethod.cs: Fix a warning.
index dca3abd48f91defdbf42f686a65ce3155acdfb5a..82bc20c3ba7c5047bfd99bf627214c289407b3c0 100644 (file)
@@ -1364,10 +1364,11 @@ namespace System.Reflection.Emit {
                        }
                }
                public void SetParent (Type parentType) {
-                       if (parentType == null)
-                               throw new ArgumentNullException ("parentType");
                        check_not_created ();
 
+                       if (parentType == null && (attrs & TypeAttributes.Interface) == 0)
+                               throw new ArgumentNullException ("parentType");
+                       
                        parent = parentType;
                        // will just set the parent-related bits if called a second time
                        setup_internal_class (this);