D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7860 - Constant fields of forward referenced structs break everything
Summary: Constant fields of forward referenced structs break everything
Status: RESOLVED DUPLICATE of issue 7859
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-04-08 12:20 UTC by siegelords_abode
Modified: 2015-06-09 04:41 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description siegelords_abode 2012-04-08 12:20:17 UTC
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 Jordi Sayol 2012-04-08 13:08:04 UTC
Regression confirmed on Linux 32-bit and 64-bit
Comment 2 Kenji Hara 2012-04-08 17:53:55 UTC
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 ***