[Mono-bugs] [Bug 70670][Wis] New - gmcs params error

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Sun, 19 Dec 2004 12:09:45 -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 spigaz@gmail.com.

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

--- shadow/70670	2004-12-19 12:09:45.000000000 -0500
+++ shadow/70670.tmp.31197	2004-12-19 12:09:45.000000000 -0500
@@ -0,0 +1,91 @@
+Bug#: 70670
+Product: Mono: Compilers
+Version: 1.1
+OS: All
+OS Details: Gento 2.6.7
+Status: NEW   
+Resolution: 
+Severity: Unknown
+Priority: Wishlist
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: spigaz@gmail.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: gmcs params error
+
+Description of Problem:
+There is some very bad error in the compilation of a generic class with
+params. Inside the same assembly the problem isn't aparently there, but
+when the class is referenced from another assembly it borks.
+
+Steps to reproduce the problem:
+1. Compile the two files into separate assemblies:
+
+gmcs Test.cs -t:library
+
+Test.cs   
+
+public class A<T>
+{
+	public A(params T[] d)
+	{
+	}
+}
+public class B // just to show that inside the same assembly it works
+{
+	public B()
+	{
+		new A<int>(1);
+		new A<int>(1, 2);
+		new A<int>(1,2,3);
+	}
+}
+
+gmcs Test2.cs -r:Test.dll -t:library
+
+Test2.cs
+
+public class C
+{
+	public C()
+	{
+		new A<int>(1);
+		new A<int>(1, 2);
+		new A<int>(1,2,3);
+	}
+}
+
+
+
+Actual Results:
+Test2.cs(6) error CS1502: The best overloaded match for method '
+A`1[System.Int32]..ctor (int[])' has some invalid arguments
+Test2.cs(6) error CS1503: Argument 0: Cannot convert from 'int' to 'int[]'
+Test2.cs(6) error CS1501: No overload for method `A`1[System.Int32]' takes
+`1' arguments
+Test2.cs(6) error CS1501: New invocation: Can not find a constructor in
+`A`1' for this argument list
+Test2.cs(7) error CS1501: No overload for method `A`1[System.Int32]' takes
+`2' arguments
+Test2.cs(7) error CS1501: New invocation: Can not find a constructor in
+`A`1' for this argument list
+Test2.cs(8) error CS1501: No overload for method `A`1[System.Int32]' takes
+`3' arguments
+Test2.cs(8) error CS1501: New invocation: Can not find a constructor in
+`A`1' for this argument list
+Compilation failed: 8 error(s), 0 warnings
+
+
+Expected Results:
+Compilation succeeded
+
+
+How often does this happen? 
+Always
+
+
+Additional Information:
+Tested with latest from svn