Re: return scope vs. scope return

2022-11-05 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 5 November 2022 at 16:13:18 UTC, 0xEAB wrote: Apparently there a difference between: - ```d Message withBody(Body body_) return scope { /* … */ } ``` - ```d Message withBody(Body body_) scope return { /* … */ } ``` ``` Deprecation: returning `this._body` escapes a

return scope vs. scope return

2022-11-05 Thread 0xEAB via Digitalmars-d-learn
Apparently there a difference between: - ```d Message withBody(Body body_) return scope { /* … */ } ``` - ```d Message withBody(Body body_) scope return { /* … */ } ``` ``` Deprecation: returning `this._body` escapes a reference to parameter `this` perhaps change the `return