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

Walter Bright <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #24 from Walter Bright <[email protected]> ---
Compiling:
-----
@safe:
class Foo {
    int[] args;
    @safe this(int[] args_...) {
        args = args_;
    }
}
Foo foo() {
    return new Foo(1, 2, 3); // passes stack data to Foo
}
void main() {
    assert(foo().args == [1, 2, 3]);
}
----

with -preview=DIP1000 yields:

  test.d(5): Error: scope variable `args_` assigned to non-scope `this.args`

meaning the compiler is working correctly.

--

Reply via email to