[Issue 17927] [scope] scope input return value can be escaped

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 23 05:35:17 UTC 2017


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

--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> ---
It turns out that:

  struct String {
    inout(char)* mem2() inout scope @safe { return ptr; }
    char* ptr;
  }

not issuing an error is actually correct, because a parameter that is `ref
inout` is inferred to be `return`, and the `this` parameter for `mem2` is `ref
inout`.

--


More information about the Digitalmars-d-bugs mailing list