Overriding a property ?

Lucien via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Apr 14 13:21:38 PDT 2016


How can I override a property ?

Test code:
----------------------------
class A
{
     @property bool foo { return false; }
     void myFunc() { ... }
}

class B : A
{
     override bool foo { return true; } // error
     override void myFunc() { ... }
}
----------------------------
Output error:
function B.foo return type inference is not supported if may 
override base class function.

Any ideas ?


More information about the Digitalmars-d-learn mailing list