[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-08 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #10 from Walter Bright --- Here's what's actually happening. It has nothing to do with inout. A reduced example: - @safe: struct S { this(int) { } char[] opSlice() return { return buf[]; } char[4] buf; } S bar();

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Walter Bright changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #9 from

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #8 from Dlang Bot --- dlang/druntime pull request #2785 "Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue 20149" was merged into stable: - 4f1568cf77085dd3ca9c5e0468c22382fcc28a0d by Mike: Add `return` to `DSO.m

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #7 from Dlang Bot --- @JinShil created dlang/druntime pull request #2785 "Add `return` to `DSO.moduleGroup()` in support of compiler fix for issue 20149" mentioning this issue: - Add `return` to `DSO.moduleGroup()` in support of compiler

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #6 from Dlang Bot --- @JinShil

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Mike Franklin changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Mike Franklin changed: What|Removed |Added See Also|https://issues.dlang.org/sh | |ow_bug.cgi?id=19965

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-09-04 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #5 from Mike Franklin --- A more reduced test case: --- import std.stdio; @safe: struct ScopeBuffer { this(char[4] init) { this.buf = init; } // The bug is that `inout` implies `return` on `this`. // See ht

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-22 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Mike Franklin changed: What|Removed |Added Keywords||accepts-invalid --

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Mike Franklin changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #4 from Mike Franklin --- > Removing all templating from the example above cause the compiler to emit > what I think is correct behavior: That may mean this is a duplicate of Issue 19965, but I'm not sure. --

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #3 from Mike Franklin --- Removing all templating from the example above cause the compiler to emit what I think is correct behavior: --- import std.stdio; @safe: struct ScopeBuffer { this(char[4] buf, size_t len = 0) {

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #2 from Mike Franklin --- Interestingly removing the `inout` attribution on `opSlice` causes the compiler to emit an error at the return statement in `fun`. I think the error should instead be emitted at the return statement of `opSlice`

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 --- Comment #1 from Mike Franklin --- > Observation-2: Decorating `opSlice` with `return` causes a compiler error to > be correctly emitted where the slice is escaping `foo` In the example above, that should be `fun`, not `foo`. --

[Issue 20149] [DIP1000] Local data escapes `opSlice` if not annotated with `return`

2019-08-21 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20149 Mike Franklin changed: What|Removed |Added Keywords||safe --