[Mono-bugs] [Bug 444388] New: CS0229/CS0122 Ambiguity on interface member hiding

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Nov 12 16:54:44 EST 2008


https://bugzilla.novell.com/show_bug.cgi?id=444388


           Summary: CS0229/CS0122 Ambiguity on interface member hiding
           Product: Mono: Compilers
           Version: 2.0
          Platform: x86-64
        OS/Version: Windows Server 2003
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: marcus at griep.us
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Compile the following in (g)mcs:
"""
interface ICollectionValue
{
  int Count { get; }
}

interface ISCGCollection
{
  int Count { get; }
}

interface ICollection : ISCGCollection, ICollectionValue
{
  new int Count { get; }
}

interface ISequenced : ICollection
{
}

class Test : ISequenced
{
  public int Count { get { return 0; } }
}

static class Maine
{
  public static void Main()
  {
    ISequenced t = new Test();
    if (t.Count != 0)
      throw new System.Exception();
  }
}
"""

and receive the following error:
"""
Test.cs(30,11): error CS0229: Ambiguity between `ISCGCollection.Count' and
`ICollectionValue.Count'
Test.cs(8,7): (Location of the symbol related to previous error)
Test.cs(30,11): error CS0122: `ICollectionValue.Count' is inaccessible due to
its protection level
Test.cs(3,7): (Location of the symbol related to previous error)
Compilation failed: 2 error(s), 0 warnings
"""

In MS csc, no error is generated as there is no ambiguity (t.Count resolves to
ICollection.Count).

This blocks compilation of the latest version of C5 using the mono compilers.


-- 
Configure bugmail: https://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