Bug 7860 – Constant fields of forward referenced structs break everything

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-08T12:20:00Z
Last change time
2015-06-09T04:41:31Z
Assigned to
nobody
Creator
siegelords_abode

Comments

Comment #0 by siegelords_abode — 2012-04-08T12:20:17Z
This code used to compile fine with DMD 2.058 but is broken in the git version of DMD: struct A(T) { enum A!(T) test = A!(T)(); static if(true) { pragma(msg, "Not printed..."); // Not printed enum A!(T) blah = A!(T)(); } } void main() { auto a = A!(char).blah; // Error: no property 'blah' for type 'A!(char)' }
Comment #1 by g.sayol — 2012-04-08T13:08:04Z
Regression confirmed on Linux 32-bit and 64-bit
Comment #2 by k.hara.pg — 2012-04-08T17:53:55Z
The root cause is same as bug 7859, and it is already fixed. Then, the sample code compiles as expected in git head (d16cfe504). *** This issue has been marked as a duplicate of issue 7859 ***