[Issue 7232] Warning: statement is not reachable has no line number

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jan 6 09:03:31 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7232



--- Comment #2 from Kenji Hara <k.hara.pg at gmail.com> 2012-01-06 09:03:30 PST ---
Technical note:

Maybe, the original issue by Robert Clipsham is "unreachable scope(failure)
should warn "statement is not reachable" _with line number_.
But today it is technically enhancement. Because:

1. Current D2 dmd does only check Exception throwing possibilities in flow
analysis.
That means Throwable is not the target of the analysis. In above code,

    scope(failure) return false;
    return true;    // (a)

dmd does not consider the statement (a) throws Throwable or not.

2. scope(failure) catches Throwable object and rethrow it. Therefore the
scope(failure) statement is always analysed as *may be reachable*.

>From the two reasons, current dmd cannot detect that the `scope(failure) return
false;` is not reachable.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list