https://issues.dlang.org/show_bug.cgi?id=22522
Dennis <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |REOPENED Resolution|WONTFIX |--- --- Comment #5 from Dennis <[email protected]> --- (In reply to Walter Bright from comment #4) > The error message isn't great, but it is correctly identifying the problem. It's saying `this` has longer lifetime than `this`. Since when does `x > x` evaluate to true? It also still works when you add `return scope` to the constructor: ``` @safe: struct S { int storage; int* ptr; this(int dummy) return scope { ptr = &storage; } int* get() return scope { return ptr; } } int* escape() { S s = S(0); return s.get; // escapes a pointer to stack variable `s` } ``` --
