[Mono-bugs] [Bug 41691][Min] New - Bug in System.Type.InvokeMember

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 22 Apr 2003 00:53:43 -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 piyush.garyali@honeywell.com.

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

--- shadow/41691	Tue Apr 22 00:53:43 2003
+++ shadow/41691.tmp.5209	Tue Apr 22 00:53:43 2003
@@ -0,0 +1,75 @@
+Bug#: 41691
+Product: Mono/Class Libraries
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Minor
+Component: CORLIB
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: piyush.garyali@honeywell.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Bug in System.Type.InvokeMember
+
+[Description of Problem]
+
+There seems to be a bug in System.Type.InvokeMember. I ran a simple
+program which uses reflection and it produced different results when
+run from Microsoft CLR and mono.
+
+[code]
+
+using System;
+using System.IO;
+using System.Reflection;
+
+public class Invoke 
+{
+	public static void Main(string [] cmdargs)
+	{
+		Type t = typeof(TypeClass);
+
+		object[] argValues = new object [] {"Hello", "World"};
+		string [] argNames = new string [] 
+{"firstName", "lastName"};
+
+		t.InvokeMember("PrintName",
+				BindingFlags.InvokeMethod,
+				null,
+				null,
+				argValues,
+				null,
+				null,
+				argNames);  
+	}
+}
+
+public class TypeClass 
+{
+	public static void PrintName(string lastName, string firstName)
+	{
+	Console.WriteLine(firstName);
+	Console.WriteLine(lastName);
+	}
+}
+
+[Actual Results, using Microsoft CLR]
+Hello
+World
+
+[Expected Results, using mono]
+World
+Hello
+
+[How often does this happen]
+Everytime
+
+[Additional Information]
+If however, the PrintName function is written like:
+public static void PrintName(string firstName, string lastName), the 
+output matches.