[Issue 19388] New: [dip1000] scope return parameters should be safely assigned in scope constructor

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Nov 10 09:04:12 UTC 2018


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

          Issue ID: 19388
           Summary: [dip1000] scope return parameters should be safely
                    assigned in scope constructor
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: ilyayaroshenko at gmail.com

struct C
{
    void* u;
    this(scope return void* v) @safe scope
    {
        this.u = v;
    }
}

<source>(6): Error: scope variable `v` assigned to `this` with longer lifetime

Compiler returned: 1

This DIP just ignores constructors. This cause a lot of issues during libraries
updates.

--


More information about the Digitalmars-d-bugs mailing list