2003-05-18 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Sun, 18 May 2003 14:33:00 +0000 (14:33 -0000)
committerMartin Baulig <martin@novell.com>
Sun, 18 May 2003 14:33:00 +0000 (14:33 -0000)
* AssemblyBuilder.cs (corlib_void_type): New internal field.
(SetCorlibTypeBuilders): Added overloaded version which takes 4
arguments to set the `corlib_void_type'.

* TypeBuilder.cs: Use `pmodule.assemblyb.corlib_void_type' instead
of `typeof (void)' to make this work when compiling corlib.

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

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

index c693b2dd8f99b95ff435e6cae72a75dcd2014054..f66dde01eff25a184d83d5c22621509d4f7a1acf 100755 (executable)
@@ -45,6 +45,7 @@ namespace System.Reflection.Emit {
                internal Type corlib_object_type = typeof (System.Object);
                internal Type corlib_value_type = typeof (System.ValueType);
                internal Type corlib_enum_type = typeof (System.Enum);
+               internal Type corlib_void_type = typeof (void);
                private int[] table_indexes;
                Hashtable us_string_cache = new Hashtable ();
 
@@ -397,6 +398,12 @@ namespace System.Reflection.Emit {
                        this.corlib_enum_type = corlib_enum_type;
                }
 
+               public void SetCorlibTypeBuilders (Type corlib_object_type, Type corlib_value_type, Type corlib_enum_type, Type corlib_void_type)
+               {
+                       SetCorlibTypeBuilders (corlib_object_type, corlib_value_type, corlib_enum_type);
+                       this.corlib_void_type = corlib_void_type;
+               }
+
                private Exception not_supported () {
                        // Strange message but this is what MS.NET prints...
                        return new NotSupportedException ("The invoked member is not supported in a dynamic module.");
index f97d4f2773d65a68c3fafbf97f1a8a3971efdd70..93e60089ca11a3ab80e3c655ccfd4d0a319b9c85 100644 (file)
@@ -1,3 +1,11 @@
+2003-05-18  Martin Baulig  <martin@ximian.com>
+
+       * AssemblyBuilder.cs (corlib_void_type): New internal field.
+       (SetCorlibTypeBuilders): Added overloaded version which takes 4
+       arguments to set the `corlib_void_type'.
+
+       * TypeBuilder.cs: Use `pmodule.assemblyb.corlib_void_type' instead
+       of `typeof (void)' to make this work when compiling corlib.
 
 Thu May 15 19:16:54 CEST 2003 Paolo Molaro <lupus@ximian.com>
 
index 8ff1f2c573d35fa12e57010478e27fc6c4ea4906..724b1d83216b7f526eb55a90702d090c2bed26b3 100644 (file)
@@ -355,7 +355,7 @@ namespace System.Reflection.Emit {
                                throw new ArgumentException ("attributes", "Interface method must be abstract and virtual.");
 
                        if (returnType == null)
-                               returnType = typeof (void);
+                               returnType = pmodule.assemblyb.corlib_void_type;
                        MethodBuilder res = new MethodBuilder (this, name, attributes, callingConvention, returnType, parameterTypes);
                        append_method (res);
                        return res;