[Issue 17686] [REG2.075] Covariant return types doesn't work with override in some cases

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Jul 26 03:33:26 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17686

--- Comment #3 from Vladimir Panteleev <dlang-bugzilla at thecybershadow.net> ---
Please include the entire test case in the bug report itself.

Here it is:

interface INode
{
    @property INode parentNode();
    @property IDocument ownerDocument();
}
interface IDocument: INode {}
interface IEntityReference: INode {}

class DOMImplementation(T)
{
    abstract class Node: INode
    {
        override
        {
            @property Node parentNode() { return null; }
            @property Document ownerDocument() { return null; }                 
        }

        @property bool readonly() { return true; }
    }
    abstract class NodeWithChildren: Node {}

    class Document: NodeWithChildren, IDocument {}

    class EntityReference: NodeWithChildren, IEntityReference
    {
        override
        {            
            @property bool readonly() { return true; }
        }        
    }

}

void main()
{
    alias aaa = DOMImplementation!string;
}

--


More information about the Digitalmars-d-bugs mailing list