[Mono-bugs] [Bug 522677] New: Ambiguity resolving in inhereted interface polymorphism reversed in comparison to .net

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Thu Jul 16 08:52:50 EDT 2009


           Summary: Ambiguity resolving in inhereted interface
                    polymorphism reversed in comparison to .net
    Classification: Mono
           Product: Mono: Compilers
           Version: 2.4.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: nsarris79 at hotmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development

Description of Problem:

Suppose :

Interface A { event Member();}
Interface A<T> : A { }

Interface B : A { new event Member();}
Interface B<T> : B, A<T>

class C : B<T>
event A.Member() {}
public event Member() {}


When C is used through B<T> in .net the ambiguity is resolved by the compiler
by selecting the first interface on the list as implementation (in this case
interface B) So (B<T>)C.Member resolves to B.Member (because B is declared
first in Interface B<T> : B, A<T>)

In Mono, the last interface is selected as default so B<T>)C.Member resolves to

Steps to reproduce the problem:

Above example

Actual Results:

(B<T>)C.Member resolves to B.Member

Expected Results:

(B<T>)C.Member should resolve to A<T>.Member to match .net

How often does this happen? 


Additional Information:

Not so much a bug as an incompatibilty with .NET

It can be resolved by declaring the member as new on the inherited interface
but nontheless, mono and .net should be 100% identical in behaviour.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.

More information about the mono-bugs mailing list