On 2015-02-09 20:00, deadalnix wrote:
DMD accept both :
int foo() {
try {
throw new Exception("blah");
} catch(Exception e) {
return 25;
}
}
and
int foo() {
try {
throw new Exception("blah");
} catch(Exception e) {
return 25;
}
return 42;
}
Which is it ? What are the rule for the unreachable statment ? It seems
that DMD is capable of figuring out that the try never returns, or it
would complain about missing return in the first case. But that do not
seems consistent with not triggering the unreachable statement in case 2.
DMD will complain about the second example if warnings are enabled.
--
/Jacob Carlborg