Bug 5918 – Cannot forward-reference to a nested enum type with any attribute

Status
RESOLVED
Resolution
WORKSFORME
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-05-02T11:34:00Z
Last change time
2013-03-04T09:05:36Z
Keywords
rejects-valid
Assigned to
nobody
Creator
kennytm
Blocks
340

Comments

Comment #0 by kennytm — 2011-05-02T11:34:03Z
Test case: ------------------------ struct T { E e; public // <-- comment this out is OK. enum E { x } } ------------------------ x.d(5): Error: enum E is forward referenced x.d(5): Error: enum E is forward referenced ------------------------ This applies to *all* kinds of attributes, like 'deprecated' or 'static' or '@safe'. The T can be changed to any kinds of aggregates (class, interface, union) and the bug still persists. Moving the 'E e;' below the 'enum E' removes the error, so is not using any attributes.
Comment #1 by lovelydear — 2012-04-23T13:03:18Z
Compiles with 2.059 Win32
Comment #2 by maximzms — 2013-03-04T09:05:36Z