[Mono-bugs] [Bug 62984][Maj] New - CustomAttributeBuilder bug

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 12 Aug 2004 19:17:07 -0400 (EDT)


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 marek.safar@seznam.cz.

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

--- shadow/62984	2004-08-12 19:17:07.000000000 -0400
+++ shadow/62984.tmp.21347	2004-08-12 19:17:07.000000000 -0400
@@ -0,0 +1,44 @@
+Bug#: 62984
+Product: Mono: Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Major
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: marek.safar@seznam.cz               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: CustomAttributeBuilder bug
+
+This code crashes with System.NullReferenceException and should be runable
+without problem.
+
+Major because it blocks one of my mcs patches.
+
+using System;
+using System.Reflection;
+using System.Reflection.Emit;
+
+[AttributeUsage (AttributeTargets.All)]
+public class My : Attribute {
+	public My (object o) {
+	}
+}
+
+public class C
+{
+    public static void Main ()
+    {
+        Type[] ctorParams = new Type[] { typeof(object) };
+        ConstructorInfo classCtorInfo = typeof(My).GetConstructor(ctorParams);
+        
+        CustomAttributeBuilder methodCABuilder = new CustomAttributeBuilder
+(classCtorInfo, new object [] { TypeCode.Double } );        
+    }
+}