Bug 316369 (MONO69057) - [GMCS] incorrect "may unify for some type parameter substitutions"
Summary: [GMCS] incorrect "may unify for some type parameter substitutions"
Status: RESOLVED FIXED
Alias: MONO69057
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Major
Target Milestone: ---
Assignee: Martin Baulig
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-03 17:11 UTC by Forgotten User NWmiVNctto
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
small sample for reproducing the bug (100 bytes, text/plain)
2004-11-09 10:33 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:57:51 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".