[Mono-bugs] [Bug 77255][Blo] New - System.Type.GetConstructor is not implemented as specified

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Sat Jan 14 09:09:47 EST 2006


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 ess at engineer.bg.

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

--- shadow/77255	2006-01-14 09:09:47.000000000 -0500
+++ shadow/77255.tmp.6271	2006-01-14 09:09:47.000000000 -0500
@@ -0,0 +1,89 @@
+Bug#: 77255
+Product: Mono: Class Libraries
+Version: 1.1
+OS: All
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: ess at engineer.bg               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Summary: System.Type.GetConstructor is not implemented as specified
+
+Please fill in this template when reporting a bug, unless you know what you
+are doing.
+Description of Problem:
+
+A ConstructorInfo instance could not be obtained for a constructor without
+parametersdue to erroneous implementation of the following method in the
+System.Type class:
+
+public ConstructorInfo GetConstructor (
+        BindingFlags bindingAttr,
+        Binder binder,
+        CallingConventions callConvention, 
+        Type[] types,
+        ParameterModifier[] modifiers)
+
+Steps to reproduce the problem:
+1. Try to get a ConstructorInfo object like this:
+
+ConstructorInfo cInfo = type.GetConstructor (Type.EmptyTypes);
+
+Actual Results:
+
+An ArgumentNullException is thrown.
+
+Expected Results:
+
+A ConstructorInfo instance if everything else would have been fine.
+
+How often does this happen? 
+
+Always
+
+Additional Information:
+
+Current implementation:
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
+    public ConstructorInfo GetConstructor (
+        BindingFlags bindingAttr,
+        Binder binder,
+        CallingConventions callConvention,					        Type[] types,
+        ParameterModifier[] modifiers) {
+			if (types == null)
+				throw new ArgumentNullException ("types");
+
+			foreach (Type t in types) {
+				if (t == null)
+					throw new ArgumentNullException ("types");
+			}
+
+			return GetConstructorImpl (bindingAttr, binder, callConvention, types,
+modifiers);
+		}
+
+Proper implementation:
+
+#if NET_2_0
+		[ComVisible (true)]
+#endif
+    public ConstructorInfo GetConstructor (
+        BindingFlags bindingAttr,
+        Binder binder,
+	CallingConventions callConvention,					        Type[] types,
+ParameterModifier[] modifiers) {
+			if (types == null)
+				throw new ArgumentNullException ("types");
+
+			return GetConstructorImpl (bindingAttr, binder, callConvention, types,
+modifiers);
+		}


More information about the mono-bugs mailing list