[Mono-bugs] [Bug 65933][Nor] Changed - No parameterless constructor defined by default with Reflection CreateType

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri May 20 19:42:22 EDT 2005


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bmaurer at users.sf.net.

http://bugzilla.ximian.com/show_bug.cgi?id=65933

--- shadow/65933	2005-03-04 10:21:17.000000000 -0500
+++ shadow/65933.tmp.19914	2005-05-20 19:42:22.000000000 -0400
@@ -1,14 +1,14 @@
 Bug#: 65933
 Product: Mono: Class Libraries
 Version: unspecified
 OS: Red Hat 9.0
 OS Details: 
-Status: REOPENED   
-Resolution: 
-Severity: 040 One week
+Status: RESOLVED   
+Resolution: FIXED
+Severity: Unknown
 Priority: Normal
 Component: CORLIB
 AssignedTo: mono-bugs at ximian.com                            
 ReportedBy: martin.tapp at cae.com               
 QAContact: mono-bugs at ximian.com
 TargetMilestone: ---
@@ -68,6 +68,19 @@
 Type wMyType2 = wAssembly.GetType("MyType2");
 
 // Next line throws since no default constructor
 object wInstance2 = Activator.CreateInstance(wMyType2);
 
 Martin
+
+------- Additional Comments From bmaurer at users.sf.net  2005-05-20 19:42 -------
+//
+// On classes, define a default constructor if not provided
+//
+if (!(IsInterface || IsValueType) && (ctors == null) && (tname !=
+"<Module>") && 
+	(GetAttributeFlagsImpl () & TypeAttributes.Abstract |
+TypeAttributes.Sealed) != (TypeAttributes.Abstract |
+TypeAttributes.Sealed))
+	DefineDefaultConstructor (MethodAttributes.Public);
+
+Your example works fine on svn.


More information about the mono-bugs mailing list