[Mono-bugs] [Bug 76417][Nor] New - improper CS0408 - cannot define overload members one of them has a generic parameter

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Wed Oct 12 04:23:50 EDT 2005


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.

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

--- shadow/76417	2005-10-12 04:23:50.000000000 -0400
+++ shadow/76417.tmp.3794	2005-10-12 04:23:50.000000000 -0400
@@ -0,0 +1,60 @@
+Bug#: 76417
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: atsushi at ximian.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: improper CS0408 - cannot define overload members one of them has a generic parameter
+
+mcs raises an error CS0408 when there is a set of overloaded methods one of
+that takes such arguments of  a generic parameter type in the generic
+class. However, it does not seem correct (see the last part of the
+description below).
+
+class Foo<T>
+{
+        public string this [int index] {
+                get { return null; }
+        }
+
+        public string this [T key] {
+                get { return null; }
+        }
+}
+
+Actual Results:
+
+possible-substitutes.cs(7,16): error CS0408: `Foo<T>' cannot define
+overload members that may unify for some type parameter substitutions
+
+Expected Results:
+
+no CS0408 error.
+
+How often does this happen? 
+
+consistently.
+
+Additional Information:
+
+Here is an excerpt from ECMA 334.
+
+25.1.7 Overloading in generic classes
+Methods, constructors, indexers, and operators within a generic class
+declaration can be overloaded. While
+signatures as declared must be unique, it is possible that substitution of
+type arguments results in identical
+signatures. The tie-breaking rules of overload resolution will pick the
+most specific one.
+
+csc compiles it as I expected from above.


More information about the mono-bugs mailing list