Bugzilla – Bug 316369
[GMCS] incorrect "may unify for some type parameter substitutions"
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by tsureshkumar@novell.com 2004-11-03 10:11:03 MST ---- 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 (); } } ---- Additional Comments From tsureshkumar@novell.com 2004-11-09 03:33:58 MST ---- Created an attachment (id=166988) small sample for reproducing the bug ---- Additional Comments From martin@ximian.com 2004-11-15 02:25:11 MST ---- See also #58303. ---- Additional Comments From martin@ximian.com 2004-11-15 02:25:34 MST ---- See also https://bugzilla.novell.com/show_bug.cgi?id=MONO58303. ---- Additional Comments From martin@ximian.com 2004-12-08 14:17:29 MST ---- Fixed. Imported an attachment (id=166988) Unknown operating system unknown. Setting to default OS "Other".