[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #1 from Dlang Bot --- @dkorpel

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 Walter Bright changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #2 from

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #3 from Dennis --- (In reply to Walter Bright from comment #2) > I suspect the problem is actually this line: > > scope int*[1] x = [&stackVar]; > > Since scope is not transitive, allowing this causes the compiler to lose > track of

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #4 from Walter Bright --- Add @safe to escape() and it will fail to compile. --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #5 from Walter Bright --- P.S. many times I've chased rabbits only to discover I forgot to add @safe. @safe really should be the default. --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #6 from Dennis --- (In reply to Walter Bright from comment #4) > Add @safe to escape() and it will fail to compile. `escape` is already under `@safe:`. I added `@safe` to escape explicitly to double check, it still compiles on my end. Wh

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #7 from Dennis --- (In reply to Walter Bright from comment #5) > P.S. many times I've chased rabbits only to discover I forgot to add @safe. > @safe really should be the default. I didn't forget @safe, I added @safe: on top (as I usually

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #8 from Walter Bright --- My bad, adding -dip1000 removes the error message. I had neglected to do that. --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #9 from Dennis --- (In reply to Walter Bright from comment #8) > My bad, adding -dip1000 removes the error message. I had neglected to do > that. I guess -dip1000 really should be the default :) --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #10 from Walter Bright --- Moving on from my previous mistakes: @safe: ref int* identity(ref return scope int* x) { return x; } int* escape() { int stackVar; scope int* x = &stackVar; int* y = identit

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #11 from Dennis --- (In reply to Walter Bright from comment #10) > No error; bad. The slicing of the return value of identity() is not properly > propagating the scope-ness of its argument x. This would be a problem in > escape.d. Yes, t

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-27 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #12 from Walter Bright --- Objections? Not at the moment, I'm just trying to thoroughly understand the problem. --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2021-11-28 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 --- Comment #13 from Walter Bright --- (In reply to Walter Bright from comment #12) > Objections? Not at the moment, I'm just trying to thoroughly understand the > problem. See the PR for my remaining objection. Thanks for your patience with this.

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2022-02-13 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 Florian Weimer changed: What|Removed |Added CC||f...@deneb.enyo.de --

[Issue 22539] [dip1000] slicing of returned ref scope static array should not be allowed

2022-03-10 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=22539 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---