Final by default?

Daniel Murphy yebbliesnospam at gmail.com
Sat Mar 15 08:34:48 PDT 2014


"bearophile"  wrote in message news:yzhcfevgjdzjtzghxtia at forum.dlang.org...

> Andrei has decided to not introduce "final by default" because he thinks 
> it's a too much large breaking change. So your real world data is an 
> essential piece of information to perform an informed decision on this 
> topic (so much essential that I think deciding before having such data is 
> void decision). So are you willing to perform your analysis on some other 
> real D code? Perhaps dub?

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. 



More information about the Digitalmars-d mailing list