[Mono-bugs] [Bug 59300][Wis] New - Mono doesn't allow null arguments for value types when invoking via reflection

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sat, 29 May 2004 15:16:56 -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 tum@veridicus.com.

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

--- shadow/59300	2004-05-29 15:16:56.000000000 -0400
+++ shadow/59300.tmp.28853	2004-05-29 15:16:56.000000000 -0400
@@ -0,0 +1,49 @@
+Bug#: 59300
+Product: Mono: Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tum@veridicus.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Mono doesn't allow null arguments for value types when invoking via reflection
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+
+using System;
+using System.Reflection;
+
+public class Test
+{
+	public static void Foo(ref int x, ref int y)
+	{
+		x = 20;
+		y = 30;
+	}
+	
+	public static void Main()
+	{
+		object[] args;
+		MethodInfo method = typeof(Test).GetMethod("Foo");
+		
+		args = new object[2];
+		
+		method.Invoke(null, args);
+		
+		Console.WriteLine("{0} {1}", args[0], args[1]);
+	}
+}
+
+The program should print "20 30" but fails with a target 
+NullReferenceException.