https://issues.dlang.org/show_bug.cgi?id=5270 --- Comment #5 from hsteoh at quickfur.ath.cx --- Removing 'scope' from func's parameter fixes the problem, since the compiler will then allocate x on the heap instead of the stack. --