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

          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: nob...@puremagic.com
          Reporter: verylonglogin....@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.

This issues is cause by druntime pull #1637 [2].

[1] https://dlang.org/spec/function.html#parameters
[2] https://github.com/dlang/druntime/pull/1637

--

Reply via email to