[Issue 18605] New: False unreachable warning generated when labeled continue is used
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Mar 13 15:28:53 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18605
Issue ID: 18605
Summary: False unreachable warning generated when labeled
continue is used
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: yshuiv7 at gmail.com
Code example:
auto test(T...)(int t) {
L:foreach(_; T) {
if (t)
continue L;
return 1;
}
new int; // <-- reported as unreachable
}
int _() {
return test!(1,2,3)(1);
}
While in reality the reachability of 'new int' is dependent on parameter 't'.
--
More information about the Digitalmars-d-bugs
mailing list