[Mono-bugs] [Bug 73992][Nor] New - [GMCS] can't resolve overloaded methods that implement generic interfaces

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Tue, 22 Mar 2005 23:31:40 -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 atsushi@ximian.com.

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

--- shadow/73992	2005-03-22 23:31:40.000000000 -0500
+++ shadow/73992.tmp.17798	2005-03-22 23:31:40.000000000 -0500
@@ -0,0 +1,52 @@
+Bug#: 73992
+Product: Mono: Compilers
+Version: 1.1
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: C#
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: atsushi@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: [GMCS] can't resolve overloaded methods that implement generic interfaces
+
+gmcs cannot resolve overloaded methods that implement different generic
+interfaces.
+
+Steps to reproduce the problem:
+
+Compile this example with gmcs.
+
+----
+using System;
+static class Test1 {
+  public interface IOp<T> {
+    T Func(uint v);
+  }
+  public struct Op : IOp<ushort>, IOp<uint> {
+    ushort IOp<ushort>.Func(uint v) { return (ushort )(v * 2); }
+    uint IOp<uint>.Func(uint v) { return v * 4; }
+  }
+  static public void Main() {
+  }
+};
+
+Actual Results:
+$ gmcs generic-overload.cs
+generic-overload.cs(7) error CS0111: Type 'Test1.Op' already defines a
+member called 'IOp.Func' with the same parameter types
+generic-overload.cs(8): 'Test1.Op.Test1+IOp`1.Func( uint)' (name of symbol
+related to previous error
+Compilation failed: 1 error(s), 0 warnings
+
+Expected Results:
+no error.
+
+How often does this happen? 
+consistently.