[Mono-bugs] [Bug 69057][Maj] New - multi level inheritance duplicates
bugzilla-daemon@bugzilla.ximian.com
bugzilla-daemon@bugzilla.ximian.com
Wed, 3 Nov 2004 10:11:04 -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 tsureshkumar@novell.com.
http://bugzilla.ximian.com/show_bug.cgi?id=69057
--- shadow/69057 2004-11-03 10:11:03.000000000 -0500
+++ shadow/69057.tmp.2622 2004-11-03 10:11:04.000000000 -0500
@@ -0,0 +1,84 @@
+Bug#: 69057
+Product: Mono: Compilers
+Version: unspecified
+OS:
+OS Details:
+Status: NEW
+Resolution:
+Severity:
+Priority: Major
+Component: C#
+AssignedTo: mono-bugs@ximian.com
+ReportedBy: tsureshkumar@novell.com
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL:
+Cc:
+Summary: multi level inheritance duplicates
+
+Description of Problem:
+
+While implementing two interfaces, of which one is derived from other, I am
+getting an error.
+
+Steps to reproduce the problem:
+1. compile the attached program
+
+Actual Results:
+> gmcs mytest.cs
+ALPHA SOFTWARE: Mono C# Compiler 1.1.1.0 for Generics
+mytest.cs(14) error CS0695: `MyTest`2<K,V>' cannot implement both
+`ITest`1<System.Collections.Generic.KeyValuePair`2<K,V>>' and
+`ITest`1<System.Collections.Generic.KeyValuePair`2<K,V>>' because they may
+unify for some type parameter substitutions
+Compilation failed: 1 error(s), 0 warnings
+
+
+Expected Results:
+Compilation Succeeded
+
+How often does this happen?
+Always
+
+Additional Information:
+
+Test Program
+
+using System;
+using System.Collections.Generic;
+
+public interface ITest <T>
+{
+ void Add ();
+}
+
+public interface ITest2 <K,V> : ITest <KeyValuePair <K,V>>
+{
+ void Subtract ();
+}
+
+public class MyTest <K,V> : ITest2 <K,V>, ITest <KeyValuePair <K,V>>
+{
+ public void Add ()
+ {
+ Console.WriteLine ("I am Add");
+ }
+
+ public void Subtract ()
+ {
+ Console.WriteLine ("I am subtract");
+ }
+
+}
+
+public class MainClass
+{
+
+ public static void Main (string [] args)
+ {
+ MyTest<string,string> mytest = new MyTest<string,string> ();
+ mytest.Add ();
+ mytest.Subtract ();
+ }
+
+}