DIP69 - Implement scope for escape proof references

Tobias Pankrath via Digitalmars-d digitalmars-d at puremagic.com
Thu Dec 4 05:49:06 PST 2014


>
> How would this be handled in the current proposal?
>
> class C
> {
>   int bar(ref T); // <-- inferred to be scope
> }
>
> class D : C
> {
>   override int bar(ref T); // <-- inferred to be NOT scope (but 
> cannot remove scope when overriding)
> }

Attribute inference only works for function literals and template 
functions. So no inference is done for both methods. Template 
methods can not be overwritten.


More information about the Digitalmars-d mailing list