[Issue 22541] DIP1000: Resolve ambiguity of ref-return-scope parameters

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Nov 24 05:54:43 UTC 2021


https://issues.dlang.org/show_bug.cgi?id=22541

--- Comment #1 from Walter Bright <bugzilla at 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

--


More information about the Digitalmars-d-bugs mailing list