Re: dip1000, perhaps annotate with return, and vibe-d

2019-07-25 Thread aliak via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 16:23:48 UTC, Paul Backus wrote: On Wednesday, 24 July 2019 at 12:54:51 UTC, aliak wrote: [...] It should go on the constructor's parameter; i.e., this(auto return ref T value) { /* ... */ } Under the hood, a constructor actually returns the constructed value

Re: dip1000, perhaps annotate with return, and vibe-d

2019-07-24 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 24 July 2019 at 12:54:51 UTC, aliak wrote: Trying to get dip1000 flag in use. I have this error: Error: returning Optional(null, false).this(value) escapes a reference to parameter value, perhaps annotate with return in this function: public auto some(T)(auto ref T value) {

dip1000, perhaps annotate with return, and vibe-d

2019-07-24 Thread aliak via Digitalmars-d-learn
Trying to get dip1000 flag in use. I have this error: Error: returning Optional(null, false).this(value) escapes a reference to parameter value, perhaps annotate with return in this function: public auto some(T)(auto ref T value) { return Optional!T(value); // <-- error on this line }