Bug 7823 – Can't use a struct initializer to initialize a nested enum used as a default function argument initializer

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-04-04T14:45:00Z
Last change time
2015-06-09T04:41:31Z
Keywords
rejects-valid
Assigned to
nobody
Creator
siegelords_abode

Comments

Comment #0 by siegelords_abode — 2012-04-04T14:45:41Z
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 by g.sayol — 2012-04-05T03:04:11Z
I confirm this regression on Linux 64-bit
Comment #2 by github-bugzilla — 2012-04-06T13:29:28Z
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