Final by default?

bearophile bearophileHUGS at lycos.com
Sun Mar 16 11:09:03 PDT 2014


Daniel Murphy:

> If anyone wants to try this out on their code, the patch I used 
> was to add this:
>
> if (ad && !ad->isInterfaceDeclaration() && isVirtual() && 
> !isFinal() &&
>    !isOverride() && !(storage_class & STCvirtual) && 
> !(ad->storage_class & STCfinal))
> {
>    warning(loc, "virtual required");
> }
>
> Around line 623 in func.c (exact line doesn't matter, just 
> stick it in with the rest of the checks)
>
> I also had to disable the "static member functions cannot be 
> virtual" error.

In the meantime has someone else measured experimentally the 
amount of breakage a "final by default" causes in significant D 
programs?

Bye,
bearophile


More information about the Digitalmars-d mailing list