https://issues.dlang.org/show_bug.cgi?id=19371
Issue ID: 19371 Summary: Taking address of ref return in @safe code: compile-time checks fail Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: dmd Assignee: nob...@puremagic.com Reporter: stanislav.bli...@gmail.com Static asserts in the snippet below shouldn't trigger: ``` void main() @safe { int x; ref int get() { return x; } static assert(!is(typeof(&get()))); static assert(!is(typeof(() @safe { return &get(); }))); static assert(!__traits(compiles, { auto p = &get(); })); //auto p = &get(); // cannot take address of ref return in @safe } ``` --