https://issues.dlang.org/show_bug.cgi?id=22916
Walter Bright <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID --- Comment #5 from Walter Bright <[email protected]> --- Looking at: ref int* index() return scope { return *ptr; } the compiler sees it as: ref return scope T index(); which is interpreted as `ref` and `return scope` attached to `this`. `a` is `this`. Since `a` is `scope`, the return value of `a.index()` is also `scope`. This `scope` return value is then passed to `assign(int*)`, where the `int*` parameter is not `scope`. Assigning `scope` to `not scope` is an error and is correctly diagnosed by the compiler. --
