[Issue 18000] New: [scope] auto-generated opAssign not scope aware

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Nov 21 15:20:55 UTC 2017


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

          Issue ID: 18000
           Summary: [scope] auto-generated opAssign not scope aware
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P3
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: code at dawg.eu

cat > bug.d << CODE
module bug;

struct File
{
@safe @nogc:
    ~this() scope
    {
    }

    void* f;
}

void test() @safe @nogc
{
    scope File f;
    f = File();
}
CODE
dmd -c -dip1000 bug
----
bug.d(16): Error: scope variable f assigned to non-scope parameter this calling
bug.File.opAssign
----

We should infer scope for any auto-generated functions like opAssign.

--


More information about the Digitalmars-d-bugs mailing list