[Mono-bugs] [Bug 39108][Wis] New - incorrect parameter array resolution for an argument with explicit cast

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Wed, 5 Mar 2003 11:02:51 -0500 (EST)


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 avd@openlinksw.com.

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

--- shadow/39108	Wed Mar  5 11:02:51 2003
+++ shadow/39108.tmp.14601	Wed Mar  5 11:02:51 2003
@@ -0,0 +1,65 @@
+Bug#: 39108
+Product: Mono/MCS
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: Misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: avd@openlinksw.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: incorrect parameter array resolution for an argument with explicit cast
+
+Description of Problem:
+
+The section 10.5.1.4 of C# Language Specification
+allows passing of parameter array argument as a
+normal paramter without putting it into new array
+only if an argument is implicitly convertible to the
+parameter array type.
+
+In the end of this section there is an example that
+shows how explicit conversion of argumment to object
+(type object cannot be implicitly converted to type
+object[]) affects resolution of normal/expanded form
+of method invocation.
+
+Mcs does this incorrectly.
+
+Steps to reproduce the problem:
+Run this program:
+
+using System;
+
+public class TestParams
+{
+    public static void Main (string[] args)
+    {
+	Params (null);
+	Params ((object) null);
+    }
+
+    private static void Params (params object[] ps)
+    {
+	if (ps == null)
+	    Console.WriteLine ("null");
+	else
+	    Console.WriteLine (ps.GetType ());
+    }
+}
+
+Actual Results:
+
+null
+null
+
+Expected Results (verified with MS .NET):
+
+null
+System.Object[]