https://issues.dlang.org/show_bug.cgi?id=19175
Issue ID: 19175 Summary: @safe code can escape local array references Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: peter.alexander...@gmail.com -------- import std.algorithm, std.stdio; @safe: auto foo() { int[6] xs = [0, 1, 2, 3, 4, 5]; return xs[].map!(x => x); } void main() { writeln(foo()); } -------- Observed: this compiles and (for me) prints [0, 0, -2132056872, 22008, 0, 0]. Expected: fail to compile with error about the escaped local reference. --