[Mono-bugs] [Bug 80257][Nor] New - Overload resolution makes explicit delegate casts fail.
bugzilla-daemon at bugzilla.ximian.com
bugzilla-daemon at bugzilla.ximian.com
Wed Dec 13 20:06:38 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 miguel at ximian.com.
http://bugzilla.ximian.com/show_bug.cgi?id=80257
--- shadow/80257 2006-12-13 20:06:38.000000000 -0500
+++ shadow/80257.tmp.30647 2006-12-13 20:06:38.000000000 -0500
@@ -0,0 +1,57 @@
+Bug#: 80257
+Product: Mono: Compilers
+Version: 1.0
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com
+ReportedBy: miguel at ximian.com
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: Overload resolution makes explicit delegate casts fail.
+
+The following program should compile, it fails because there is an overload
+that takes an object:
+
+public delegate object Get (Do d);
+
+public class Do {
+ public void Register (Get g)
+ {
+ }
+
+ public void Register (object g)
+ {
+ }
+
+ static object MyGet (Do d)
+ {
+ return null;
+ }
+
+ public void X ()
+ {
+ Register (Do.MyGet);
+ }
+}
+
+public class User {
+ static void Main ()
+ {
+ }
+}
+
+If the overload void Register (object g) is removed, the program compiles,
+otherwise it produces:
+
+par.cs(19,13): error CS0654: Method `Do.MyGet()' is referenced without
+parentheses
+Compilation failed: 1 error(s), 0 warnings
+
+It builds fine with CSC 2
More information about the mono-bugs
mailing list