www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 792] New: Erroneous "statement is not reachable" on class declaration

reply d-bugmail puremagic.com writes:

           Summary: Erroneous "statement is not reachable" on class
           Product: D
           Version: 1.00
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: luismarques 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

Jan 04 2007
parent d-bugmail puremagic.com writes:

Luís Marques <luismarques gmail.com> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

PDT ---
Georg Wrede tested it as solved with DMD 1.042.

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