Tue Jul 9 19:03:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Tue, 9 Jul 2002 17:05:19 +0000 (17:05 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Tue, 9 Jul 2002 17:05:19 +0000 (17:05 -0000)
* TypeBuilder.cs: special case SerializarionAttribute.
Tweaks to get correct code in corlib.

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

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

index 7a142377f95417ed93e15659df061015f6226902..3f7257b29636c1d120e7c058da9663865199ebf1 100644 (file)
@@ -1,3 +1,9 @@
+
+Tue Jul 9 19:03:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+       * TypeBuilder.cs: special case SerializarionAttribute.
+       Tweaks to get correct code in corlib.
+
 2002-07-06  Miguel de Icaza  <miguel@ximian.com>
 
        * ILGenerator.cs (ILGenerator.Emit): For doubles and floats, swap
index 653638df0a11c39a9e1c9fa3e13dff1fddff0d79..1013a8b83bf5ee96c52e15c57778ecde744962a5 100644 (file)
@@ -553,8 +553,7 @@ namespace System.Reflection.Emit {
                }
 
                protected override bool IsArrayImpl () {
-                       // FIXME
-                       return false;
+                       return type_is_subtype_of (this, typeof (System.Array), false);
                }
                protected override bool IsByRefImpl () {
                        // FIXME
@@ -572,8 +571,14 @@ namespace System.Reflection.Emit {
                        return false;
                }
                protected override bool IsValueTypeImpl () {
-                       // test this one
-                       return type_is_subtype_of (this, pmodule.assemblyb.corlib_value_type, false);
+                       //Console.WriteLine ("is value type: {0}: {1} ({2}) base: {3}", AssemblyQualifiedName, type_is_subtype_of (this, pmodule.assemblyb.corlib_value_type, false), pmodule.assemblyb.corlib_value_type.AssemblyQualifiedName, BaseType != null?BaseType.AssemblyQualifiedName: "");
+                       return (type_is_subtype_of (this, pmodule.assemblyb.corlib_value_type, false) || type_is_subtype_of (this, typeof(System.ValueType), false));
+//                             this != pmodule.assemblyb.corlib_value_type &&
+//                             this != typeof (System.Enum); /* FIXME: handle a TypeBuilder System.Enum */
+
+/*                     return type_is_subtype_of (this, typeof(System.ValueType), false) &&
+                               this != typeof(System.ValueType) &&
+                               this != typeof (System.Enum);*/
                }
                
                public override RuntimeTypeHandle TypeHandle { get { return _impl; } }
@@ -666,6 +671,9 @@ namespace System.Reflection.Emit {
                                        }
                                }
                                return;
+                       } else if (attrname == "System.SerializableAttribute") {
+                               attrs |= TypeAttributes.Serializable;
+                               return;
                        }
                        if (cattrs != null) {
                                CustomAttributeBuilder[] new_array = new CustomAttributeBuilder [cattrs.Length + 1];