return ref this -dip1000

vit vit at vit.vit
Mon Dec 11 20:40:09 UTC 2017


This code doesn't compile with -dip1000:

struct Foo{
     int foo;


     ref int bar(){

         return foo;
     }
}

Error: returning `this.foo` escapes a reference to parameter 
`this`, perhaps annotate with `return`


How can be annotated this parameter with 'return ref' ?


More information about the Digitalmars-d-learn mailing list