https://issues.dlang.org/show_bug.cgi?id=17370
ZombineDev <petar.p.ki...@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |petar.p.ki...@gmail.com --- Comment #1 from ZombineDev <petar.p.ki...@gmail.com> --- The issue is with only with the auto generated constructor. If you write one yourself, you get: void main () @safe { int* ptr = fwd(); assert(ptr !is null); } int* fwd () @safe { int i; return new Struct(&i).oops; } struct Struct { int* oops; this(int* p) @safe { oops = p; } } scope_bug17370.d(10): Error: reference to local variable i assigned to non-scope parameter p calling scope_bug17370.Struct.this --