[Issue 14835] Statement is not reachable doesn't play along generic code
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Oct 11 20:46:18 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=14835
Walter Bright <bugzilla at digitalmars.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |bugzilla at digitalmars.com
--- Comment #8 from Walter Bright <bugzilla at digitalmars.com> ---
It seems the problem lies here:
https://github.com/dlang/dmd/blob/master/src/statement.d#L453
if (s.condition.isBool(true))
{
if (s.ifbody)
result |= s.ifbody.blockExit(func, mustNotThrow);
else
result |= BEfallthru;
}
else if (s.condition.isBool(false))
{
if (s.elsebody)
result |= s.elsebody.blockExit(func, mustNotThrow);
else
result |= BEfallthru;
}
else
Having it set BEfallthru as if both ifbody and elsebody could execute should
work, but I wonder about its affect on existing code.
--
More information about the Digitalmars-d-bugs
mailing list