Safe reference counting cannot be implemented as a library

Sebastiaan Koppe via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 27 19:08:16 PDT 2015


On Tuesday, 27 October 2015 at 11:41:52 UTC, Andrei Alexandrescu 
wrote:
> The crux of the matter is modular typechecking. Consider the 
> following example:
>
> // module widget.d
> @safe class Widget {
>   void fun() {
>     g_widget = this;
>   }
> }
> static Widget g_widget;
> // end of module widget.d
>
> Now, once the typechecker OKs module widget.d, the summary that 
> all other typechecking "sees" is:
>
> @safe class Widget {
>   void fun();
> }

Isn't it a shame that that kind of information gets tossed aside? 
Seems to be very valuable and the loss of it the cause of several 
issues.


More information about the Digitalmars-d mailing list