[Issue 792] New: Erroneous "statement is not reachable" on class declaration

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 4 06:06:52 PST 2007


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

           Summary: Erroneous "statement is not reachable" on class
                    declaration
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: luismarques at gmail.com


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?


-- 



More information about the Digitalmars-d-bugs mailing list