Bug 10250 – Grammar does not allow invariants in struct declarations

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-06-03T00:42:00Z
Last change time
2014-02-12T23:35:44Z
Keywords
accepts-invalid, spec
Assigned to
nobody
Creator
briancschott
Blocks
10233

Comments

Comment #0 by briancschott — 2013-06-03T00:42:03Z
The following code compiles: struct TestStruct { invariant() {} } void main(string[] args) {} but the specification only mentions invariants being valid inside of class bodies. Either DMD or the specification is wrong.
Comment #1 by k.hara.pg — 2014-02-12T23:35:44Z