Bug 1843 – Bogus unreachable statement on forward referenced struct, lacks line number

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
All
Creation time
2008-02-16T06:13:00Z
Last change time
2014-02-24T15:32:54Z
Keywords
diagnostic, rejects-valid
Assigned to
bugzilla
Creator
larsivar
Blocks
340

Comments

Comment #0 by larsivar — 2008-02-16T06:13:55Z
I expect this to be a general problem with this particular warning: warning - Error: statement is not reachable In case that isn't enough, the link below shows a file that expose this twice. http://www.dsource.org/projects/tango/browser/trunk/tango/io/archive/Zip.d?rev=3200
Comment #1 by matti.niemenmaa+dbugzilla — 2008-02-16T06:49:18Z
No, this is actually worse. The warning comes from the following minimal example, and it has to do with forward referencing: class ZipEntry { ZipEntryInfo info; this() {} } struct ZipEntryInfo {} Move ZipEntryInfo above ZipEntry and the warnings disappear.
Comment #2 by bugzilla — 2008-03-07T00:31:08Z
Fixed dmd 1.028 and 2.012