July 03, 2019 [Issue 20023] New: Separate compilation breaks dip1000 / dip1008 @safety | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=20023 Issue ID: 20023 Summary: Separate compilation breaks dip1000 / dip1008 @safety Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P1 Component: dmd Assignee: nobody@puremagic.com Reporter: john.loughran.colvin@gmail.com // test.d import test2; void main() { threw!()(); } // test2.d auto threw()() @safe { try throw new Exception("Hello"); catch (Exception e) return e; assert(0); } # dmd test.d -dip1000 -dip1008 -dip25 -c # dmd test2.d -dip1000 -dip1008 -dip25 -c # dmd test.obj test2.obj Happy to compile despite the bug # dmd test.d test2.d -dip1000 -dip1008 -dip25 test2.d(6): Error: scope variable e may not be returned test.d(5): Error: template instance `test2.threw!()` error instantiating Catches the problem correctly -- |
Copyright © 1999-2021 by the D Language Foundation