[Issue 17718] [scope] function literal arguments can be escaped

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Aug 22 07:46:36 PDT 2017


https://issues.dlang.org/show_bug.cgi?id=17718

--- Comment #1 from ZombineDev <petar.p.kirov at gmail.com> ---
If I change the structure to:

struct S
{
    int p;
    int* leak() return scope { return &p; }
}

I get:
scope_bug17718.d(9): Error: returning s.leak() escapes a reference to parameter
s, perhaps annotate with return

Where exactly is one supposed to add return?

--


More information about the Digitalmars-d-bugs mailing list