Thread overview
[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters
[Issue 22541] Resolve ambiguity of ref-return-scope parameters
6 days ago
Walter Bright
6 days ago
Walter Bright
6 days ago
Walter Bright
5 days ago
Dennis
4 days ago
Dlang Bot
28 minutes ago
Walter Bright
6 days ago
https://issues.dlang.org/show_bug.cgi?id=22541

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |safe

--
6 days ago
https://issues.dlang.org/show_bug.cgi?id=22541

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Resolve ambiguity of        |DIP1000: Resolve ambiguity
                   |ref-return-scope parameters |of ref-return-scope
                   |                            |parameters

--
6 days ago
https://issues.dlang.org/show_bug.cgi?id=22541

--- Comment #1 from Walter Bright <bugzilla@digitalmars.com> ---
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

--
5 days ago
https://issues.dlang.org/show_bug.cgi?id=22541

Dennis <dkorpel@live.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dkorpel@live.nl

--- Comment #2 from Dennis <dkorpel@live.nl> ---
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.

--
4 days ago
https://issues.dlang.org/show_bug.cgi?id=22541

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@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

--
28 minutes ago
https://issues.dlang.org/show_bug.cgi?id=22541

--- Comment #4 from Walter Bright <bugzilla@digitalmars.com> ---
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.

--