[Mono-bugs] [Bug 77816][Nor] New - r56802/r58039 brought incorrect CS0121 (anonymous method ambiguity)

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Mar 17 12:38:41 EST 2006

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 atsushi at ximian.com.


--- shadow/77816	2006-03-17 12:38:41.000000000 -0500
+++ shadow/77816.tmp.30985	2006-03-17 12:38:41.000000000 -0500
@@ -0,0 +1,66 @@
+Bug#: 77816
+Product: Mono: Compilers
+Version: 1.1
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: r56802/r58039 brought incorrect CS0121 (anonymous method ambiguity)
+Seems like there is a new anonymous method bug on anonymous method type
+ambiguity detection.
+public class Test
+        public static void Main ()
+        {
+                new Test (delegate () {});
+        }
+        public Test (TestMethod test) {}
+        public Test (TestMethod2 test2) {}
+public delegate void TestMethod ();
+public delegate void TestMethod2 (object o);
+Actual Results:
+mcs anonymous-ambiguity.cs
+anonymous-ambiguity.cs(5,3): error CS0121: The call is ambiguous between
+the following methods or properties: `Test.Test(TestMethod)' and
+anonymous-ambiguity.cs(8,9):: `Test.Test(TestMethod)', name of symbol
+related to previous error
+anonymous-ambiguity.cs(8,9):: `Test.Test(TestMethod)', name of symbol
+related to previous error
+anonymous-ambiguity.cs(9,9):: `Test.Test(TestMethod2)', name of symbol
+related to previous error
+Compilation failed: 1 error(s), 0 warnings
+Expected Results:
+no CS0121 error.
+How often does this happen? 
+Additional Information:
+The actual problem happens between ThreadStart and ParameterizedThreadStart
+, so I guess every anonymous method use for ThreadStart is now broken (a
+bit of luck is that ParameterizedThreadStart is only 2.0 delegate, so it
+won't happen with mcs).
+Marek: can you please have a look at this one? r58038 worked fine, while
+r58039 does not.

More information about the mono-bugs mailing list