[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Dlang Bot changed: What|Removed |Added Status|REOPENED|RESOLVED Resolution|--- |FIXED --- Comment #9 from Dlang Bot --- dlang/dmd pull request #13677 "fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope para…" was merged into master: - a435fa4a2cd64b47f234bdc2b3843d9624582731 by Walter Bright: fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope parameters https://github.com/dlang/dmd/pull/13677 --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 --- Comment #8 from Dlang Bot --- @WalterBright created dlang/dmd pull request #13677 "fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope para…" fixing this issue: - fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope parameters https://github.com/dlang/dmd/pull/13677 --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Dennis changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|FIXED |--- --- Comment #7 from Dennis --- As mentioned in the PR, that was only a partial fix, this still fails: ``` struct S { int i; int* ptr; int* wannabeReturnRef() scope return { return } } ``` Error: returning `` escapes a reference to parameter `this` perhaps remove `scope` parameter annotation so `return` applies to `ref` --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Dlang Bot changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #6 from Dlang Bot --- dlang/dmd pull request #13357 "fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope para…" was merged into master: - 7754800627f4f37bc16e49d123cd6db6597e7c3a by Walter Bright: fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope parameters https://github.com/dlang/dmd/pull/13357 --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 --- Comment #5 from Dennis --- (In reply to Walter Bright from comment #4) > Where I'd like to go is only allow "return ref" or "return scope". In the > meantime, backwards compatibility will do for the first iteration. Yes, let's do that! --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 --- Comment #4 from Walter Bright --- Where I'd like to go is only allow "return ref" or "return scope". In the meantime, backwards compatibility will do for the first iteration. --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Dlang Bot changed: What|Removed |Added Keywords||pull --- Comment #3 from Dlang Bot --- @WalterBright created dlang/dmd pull request #13357 "fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope para…" fixing this issue: - fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope parameters https://github.com/dlang/dmd/pull/13357 --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Dennis changed: What|Removed |Added CC||dkor...@live.nl --- Comment #2 from Dennis --- I do like the idea of looking for adjacent `return scope`. I don't like the complexity behind rules a..e, I'd rather simplify it than add on top of that, so how about an alternative proposal: When adjacent keywords `return scope` are present, the result is `ref returnScope`. Everything else results in `returnRef scope`. You can make returnRef member functions with `scope return`, no new grammar needed. It also covers issue 20881. --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 --- Comment #1 from Walter Bright --- For struct member functions: struct S { T foo() return scope { ... } } the first parameter is `ref S`. But the ambiguity is resolved by allowing `ref` to appear after the `foo()`, as in: T foo() return ref scope { ... } // returnRef scope T foo() ref return scope { ... } // ref returnScope --
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
https://issues.dlang.org/show_bug.cgi?id=22541 Walter Bright changed: What|Removed |Added Summary|Resolve ambiguity of|DIP1000: Resolve ambiguity |ref-return-scope parameters |of ref-return-scope ||parameters --