Sat Jul 13 15:08:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
authorPaolo Molaro <lupus@oddwiz.org>
Sat, 13 Jul 2002 13:11:01 +0000 (13:11 -0000)
committerPaolo Molaro <lupus@oddwiz.org>
Sat, 13 Jul 2002 13:11:01 +0000 (13:11 -0000)
* TypeBuilder.cs: better IsValueType.

Sat Jul 13 15:09:01 CEST 2002 Paolo Molaro <lupus@ximian.com>

* Type.cs: make GettTypeCode an icall. Test implementation of
GetMember().

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

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

index a2c83c949e63ab58ae423e5fb8b89af1b6d33b58..a4014522fdc972d2bab5e5c60ef39e390cf37220 100644 (file)
@@ -1,3 +1,8 @@
+
+Sat Jul 13 15:08:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+       * TypeBuilder.cs: better IsValueType.
+
 2002-07-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * CustomAttributeBuilder.cs: removed compile warning.
index 3b3395896ba59d7d8ada2530a801394c632ddff7..02ba64986cda365a729c9c26feb789c68d7dd09e 100755 (executable)
@@ -97,10 +97,6 @@ namespace System.Reflection.Emit {
                        attrs |= ParameterAttributes.HasFieldMarshal;
                }
 
-
-
-
-
        }
 }
 
index 1013a8b83bf5ee96c52e15c57778ecde744962a5..4e37638d6a45919d591aafcb949885ca7d725242 100644 (file)
@@ -572,9 +572,9 @@ namespace System.Reflection.Emit {
                }
                protected override bool IsValueTypeImpl () {
                        //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, 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) &&
index bafb873f055d3e43ea6f80a94882bf4f43ac768c..bd1c83cb568564425c7d1404b377db214c6d1d1c 100644 (file)
@@ -1,3 +1,9 @@
+
+Sat Jul 13 15:09:01 CEST 2002 Paolo Molaro <lupus@ximian.com>
+
+       * Type.cs: make GettTypeCode an icall. Test implementation of
+       GetMember().
+
 2002-07-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
 
        * AppDomainSetup.cs: implemented LoaderOptimization.
index bea8d18d1d9f66c0a654273cb90b6100febc7d75..fd057dca951efa21331bf5311601b3aa44689078 100644 (file)
@@ -389,52 +389,8 @@ namespace System {
                        return ret;
                }
 
-               [MonoTODO]
-               public static TypeCode GetTypeCode (Type type)
-               {
-                       // FIXME -- this is most likely too simplistic for all cases;
-                       //  e.g. Enums
-
-                       if (type.IsArray)
-                               return TypeCode.Object;
-
-                       Type ust = type.UnderlyingSystemType;
-
-                       if (ust == typeof (Boolean))
-                               return TypeCode.Boolean;
-                       if (ust == typeof (Byte))
-                               return TypeCode.Byte;
-                       if (ust == typeof (Char))
-                               return TypeCode.Char;
-                       if (ust == typeof (DateTime))
-                               return TypeCode.DateTime;
-                       if (ust == typeof (DBNull))
-                               return TypeCode.DBNull;
-                       if (ust == typeof (Decimal))
-                               return TypeCode.Decimal;
-                       if (ust == typeof (Double))
-                               return TypeCode.Double;
-                       if (ust == typeof (Int16))
-                               return TypeCode.Int16;
-                       if (ust == typeof (Int32))
-                               return TypeCode.Int32;
-                       if (ust == typeof (Int64))
-                               return TypeCode.Int64;
-                       if (ust == typeof (SByte))
-                               return TypeCode.SByte;
-                       if (ust == typeof (Single))
-                               return TypeCode.Single;
-                       if (ust == typeof (String))
-                               return TypeCode.String;
-                       if (ust == typeof (UInt16))
-                               return TypeCode.UInt16;
-                       if (ust == typeof (UInt32))
-                               return TypeCode.UInt32;
-                       if (ust == typeof (UInt64))
-                               return TypeCode.UInt64;
-
-                       return TypeCode.Object;
-               }
+               [MethodImplAttribute(MethodImplOptions.InternalCall)]
+               public extern static TypeCode GetTypeCode (Type type);
 
                [MonoTODO]
                public static Type GetTypeFromCLSID (Guid clsid)
@@ -588,7 +544,7 @@ namespace System {
                public virtual MemberInfo[] GetMember (string name, MemberTypes type,
                                                       BindingFlags bindingAttr)
                {
-                       throw new NotSupportedException ();     // according to MSDN
+                       return FindMembers (type, bindingAttr, FilterName, name);
                }
 
                public MemberInfo[] GetMembers()