www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16504] New: `dup` can't use storage calss `scope` for its


          Issue ID: 16504
           Summary: `dup` can't use storage calss `scope` for its
                    parameter in general
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: verylonglogin.reg gmail.com

Currently `scope` is documented [1] as

 references in the parameter cannot be escaped
and `dup` is called for unrestricted set of types so type's postblit can assign references from the parameter to global variable thus violating `scope` storage class assumptions as there is no such restrictions for postblits. [1] https://dlang.org/spec/function.html#parameters [2] https://github.com/dlang/druntime/pull/1637 --
Sep 17 2016