D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7823 - Can't use a struct initializer to initialize a nested enum used as a default function argument initializer
Summary: Can't use a struct initializer to initialize a nested enum used as a default ...
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 regression
Assignee: No Owner
URL:
Keywords: rejects-valid
Depends on:
Blocks:
 
Reported: 2012-04-04 14:45 UTC by siegelords_abode
Modified: 2015-06-09 04:41 UTC (History)
2 users (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-04 14:45:41 UTC
struct A
{
    long a;
    enum A b = {0}; // Error: variable test.A.test2 enum cannot be initialized with {0}
}

void test(A a = A.b) // Triggers it
{
    
}

void main() {}

Works in 2.058 but not the 2.059 git version.
Comment 1 Jordi Sayol 2012-04-05 03:04:11 UTC
I confirm this regression on Linux 64-bit
Comment 2 github-bugzilla 2012-04-06 13:29:28 UTC
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/b548a3d7a9c8e8999fd94e22d24c6d7a185101e4
fix Issue 7823 - Can't use a struct initializer to initialize a nested enum used as a default function argument initializer