2003-07-23 Ravi Pratap <ravi@ximian.com>
authorRavi Pratap M <ravi@mono-cvs.ximian.com>
Wed, 23 Jul 2003 21:30:13 +0000 (21:30 -0000)
committerRavi Pratap M <ravi@mono-cvs.ximian.com>
Wed, 23 Jul 2003 21:30:13 +0000 (21:30 -0000)
* Type.cs, TypeBuilder.cs, MonoType.cs: Fixes to IsArrayImpl
from Paolo in response to bug #45993.

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

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

index ce7bc41ae99faede4e333a4262107b82b78d94cf..23e6424152119f247f7d9108a8f8ace69928bfcb 100644 (file)
@@ -1,3 +1,8 @@
+2003-07-23  Ravi Pratap  <ravi@ximian.com>
+
+       * Type.cs, TypeBuilder.cs, MonoType.cs: Fixes to IsArrayImpl
+       from Paolo in response to bug #45993.
+
 2003-07-23  Lluis Sanchez Gual  <lluis@ximian.com>
 
        * corlib_test.dll.sources: added System.Runtime.Serialization/SerializationTest.cs
index 14bbd5d1d29fdb3643481cf83b6edbac0c14454e..24bcfa602ca76cf3c03558206a616c90baa78cb2 100644 (file)
@@ -104,6 +104,22 @@ namespace System.Reflection.Emit {
                }
                public override Type DeclaringType {get {return nesting_type;}}
 
+/*             public override bool IsSubclassOf (Type c)
+               {
+                       Type t;
+                       if (c == null)
+                               return false;
+                       if (c == this)
+                               return false;
+                       t = parent;
+                       while (t != null) {
+                               if (c == t)
+                                       return true;
+                               t = t.BaseType;
+                       }
+                       return false;
+               }*/
+
                [MonoTODO]
                public override Type UnderlyingSystemType {
                        get {
@@ -715,9 +731,11 @@ namespace System.Reflection.Emit {
                        throw not_supported ();
                }
 
-               protected override bool IsArrayImpl () {
-                       return type_is_subtype_of (this, typeof (System.Array), false);
+               protected override bool IsArrayImpl ()
+               {
+                       return Type.IsArrayImpl (this);
                }
+
                protected override bool IsByRefImpl () {
                        // FIXME
                        return false;
index 843e4a9c30eca2e540f011c48911b24c6bef2069..a2af09be6f49218cdc01bd555208bb6bfb774580 100644 (file)
@@ -253,7 +253,7 @@ namespace System
 
                protected override bool IsArrayImpl ()
                {
-                       return type_is_subtype_of (this, typeof (System.Array), false) && this != typeof (System.Array);
+                       return Type.IsArrayImpl (this);
                }
 
                [MethodImplAttribute(MethodImplOptions.InternalCall)]
index d6d6c44d0c594ae6948e5a0053dd6edea718c541..7674a7c603a499f10bb43bf853bfc178300f5f52 100644 (file)
@@ -757,6 +757,9 @@ namespace System {
                protected abstract bool IsPointerImpl ();
                protected abstract bool IsPrimitiveImpl ();
                
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               internal static extern bool IsArrayImpl (Type type);
+
                protected virtual bool IsValueTypeImpl ()
                {
                        if (this == typeof (Enum) || this == typeof (ValueType))