www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19388] New: [dip1000] scope return parameters should be

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 puremagic.com
          Reporter: ilyayaroshenko 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.

--
Nov 10 2018