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

          Issue ID: 19387
           Summary: [dip1000] __fieldPostblit should be scope or deduce
                    scope qualifier
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: [email protected]
          Reporter: [email protected]

Currently, the __fieldPostblit constructor is not scope, this cause bugs that
looks like:
scope variable __copytmpXXX assigned to non-scope parameter this calling
AType.__fieldPostblit.

For example:
------------
struct C
{
    void* u;
    this(this) scope @safe {}
}

struct S { C c; }
void foo(scope S s) @safe {}
void bar(scope S s) @safe { foo(s); }
------------
<source>(9): Error: scope variable `__copytmp2` assigned to non-scope parameter
`this` calling example.S.__fieldPostblit

Compiler returned: 1

--

Reply via email to