[Issue 7807] New: Ambiguous virtual function error on const overloading with covariant return types

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 1 13:54:45 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7807

           Summary: Ambiguous virtual function error on const overloading
                    with covariant return types
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: rbixby at hotmail.com


--- Comment #0 from Read Bixby <rbixby at hotmail.com> 2012-04-01 13:55:17 PDT ---
The following code produces the error:  "Error: class Implementation ambiguous
virtual function getNext"

interface Interface
{
    Interface getNext();
    const(Interface) getNext() const;
}

class Implementation : Interface
{
    Implementation getNext()
    {
        return null;
    }

    const(Implementation) getNext() const
    {
        return null;
    }
}

The error does not appear if "Interface" is changed to an abstract class.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list