Bug 792 – Erroneous "statement is not reachable" on class declaration
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-01-04T08:06:00Z
Last change time
2014-02-15T13:13:07Z
Keywords
diagnostic
Assigned to
bugzilla
Creator
luis
Comments
Comment #0 by luis — 2007-01-04T08:06:32Z
The example class provided bellow gives an erroneous "warning - Error: statement is not reachable":
1: class A
2: {
3: B b;
4: private struct B {}
5: this() {}
6: }
If the "struct B" is declared before "b" (lines 3 and 4 swapped) then it compiles OK. The same happens if the constructor is removed.
This bug is more onerous because no file nor line is provided in the description (I had to look into many files to guess what the problem was). Is that a bug in the bug too, or should there be cases where the file:line is not provided?