Inheritance of purity

deadalnix deadalnix at
Fri Feb 24 04:41:23 PST 2012

Le 18/02/2012 19:25, Walter Bright a écrit :
> On 2/18/2012 6:49 AM, kenji hara wrote:
>> After some thoughts, I agree that inheritance of pure @safe, and
>> nothrow is good feature.
>> But I disagree to const inference, because const attribute interacts
>> with overloadings.
> The const inheritance *only* happens if otherwise you'd get a covariance
> error. It does not change the meaning of any existing code that compiled
> successfully.

yes but then, if a method is added to the base class, you will have a 
changement of behavior of all overriden method, silently.

It means nasty bugs, an hours spent to go throw the whole codebase and 
review manually which method do we want to override in each cases.

The current state of D is very inconsistent on this topic and it lead to 
many quirks.

More information about the Digitalmars-d mailing list