Author: zoltan
Date: 2005-03-09 07:29:24 -0500 (Wed, 09 Mar 2005)
New Revision: 41595
Modified:
trunk/mcs/class/corlib/System/Activator.cs
trunk/mcs/class/corlib/System/ChangeLog
trunk/mcs/class/corlib/System/MonoType.cs
Log:
2005-03-09 Zoltan Varga <[EMAIL PROTECTED]>
* Activator.cs MonoType.cs: Applied patch from Carlos Alberto Cortez
([EMAIL PROTECTED]). Allow creation of valuetypes with no ctor.
Fixes #73432.
Modified: trunk/mcs/class/corlib/System/Activator.cs
===================================================================
--- trunk/mcs/class/corlib/System/Activator.cs 2005-03-09 11:52:07 UTC (rev
41594)
+++ trunk/mcs/class/corlib/System/Activator.cs 2005-03-09 12:29:24 UTC (rev
41595)
@@ -278,6 +278,6 @@
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern object CreateInstanceInternal (Type type);
+ internal static extern object CreateInstanceInternal (Type
type);
}
}
Modified: trunk/mcs/class/corlib/System/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/System/ChangeLog 2005-03-09 11:52:07 UTC (rev
41594)
+++ trunk/mcs/class/corlib/System/ChangeLog 2005-03-09 12:29:24 UTC (rev
41595)
@@ -1,3 +1,9 @@
+2005-03-09 Zoltan Varga <[EMAIL PROTECTED]>
+
+ * Activator.cs MonoType.cs: Applied patch from Carlos Alberto Cortez
+ ([EMAIL PROTECTED]). Allow creation of valuetypes with no ctor.
+ Fixes #73432.
+
2005-03-04 Zoltan Varga <[EMAIL PROTECTED]>
* Environment.cs: Bump corlib version.
Modified: trunk/mcs/class/corlib/System/MonoType.cs
===================================================================
--- trunk/mcs/class/corlib/System/MonoType.cs 2005-03-09 11:52:07 UTC (rev
41594)
+++ trunk/mcs/class/corlib/System/MonoType.cs 2005-03-09 12:29:24 UTC (rev
41595)
@@ -329,8 +329,12 @@
ConstructorInfo[] ctors = GetConstructors
(invokeAttr);
object state = null;
MethodBase ctor = binder.BindToMethod
(invokeAttr, ctors, ref args, modifiers, culture, namedParameters, out state);
- if (ctor == null)
- throw new MissingMethodException ();
+ if (ctor == null) {
+ if (this.IsValueType && args == null)
+ return
Activator.CreateInstanceInternal (this);
+
+ throw new MissingMethodException
("Constructor on type '" + FullName + "' not found.");
+ }
object result = ctor.Invoke (target,
invokeAttr, binder, args, culture);
binder.ReorderArgumentArray (ref args, state);
return result;
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches