Author: zoltan
Date: 2005-03-09 07:33:16 -0500 (Wed, 09 Mar 2005)
New Revision: 41597
Modified:
branches/mono-1-0/mcs/class/corlib/System/Activator.cs
branches/mono-1-0/mcs/class/corlib/System/ChangeLog
branches/mono-1-0/mcs/class/corlib/System/MonoType.cs
Log:
Merge from HEAD.
Modified: branches/mono-1-0/mcs/class/corlib/System/Activator.cs
===================================================================
--- branches/mono-1-0/mcs/class/corlib/System/Activator.cs 2005-03-09
12:32:07 UTC (rev 41596)
+++ branches/mono-1-0/mcs/class/corlib/System/Activator.cs 2005-03-09
12:33:16 UTC (rev 41597)
@@ -278,6 +278,6 @@
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- private static extern object CreateInstanceInternal (Type type);
+ internal static extern object CreateInstanceInternal (Type
type);
}
}
Modified: branches/mono-1-0/mcs/class/corlib/System/ChangeLog
===================================================================
--- branches/mono-1-0/mcs/class/corlib/System/ChangeLog 2005-03-09 12:32:07 UTC
(rev 41596)
+++ branches/mono-1-0/mcs/class/corlib/System/ChangeLog 2005-03-09 12:33:16 UTC
(rev 41597)
@@ -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-02-11 Zoltan Varga <[EMAIL PROTECTED]>
* Type.cs (IsAssignableFrom): Add support for TypeBuilders.
Modified: branches/mono-1-0/mcs/class/corlib/System/MonoType.cs
===================================================================
--- branches/mono-1-0/mcs/class/corlib/System/MonoType.cs 2005-03-09
12:32:07 UTC (rev 41596)
+++ branches/mono-1-0/mcs/class/corlib/System/MonoType.cs 2005-03-09
12:33:16 UTC (rev 41597)
@@ -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