Bug 4049 – enum constant with no initializer

Status
RESOLVED
Resolution
INVALID
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-04-02T14:37:00Z
Last change time
2015-06-09T05:13:48Z
Keywords
rejects-valid
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-04-02T14:37:38Z
This program correctly gives an error message, but I don't see why this code is wrong, here f can be just f.init: struct Foo {} enum Foo f; void main() {} dmd 2.042 gives: test.d(2): Error: variable test.f manifest constants must have initializers
Comment #1 by bearophile_hugs — 2010-04-04T07:51:23Z
People seem to not like this idea, saying this is usually a bug, so I close it.