← Back to index
|
Original Bugzilla link
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
Fixed by:
https://github.com/D-Programming-Language/dlang.org/pull/489
--- Now `DeclDefs` contains `Invariant`:
https://github.com/9rnsr/dlang.org/commit/ffb0412cd514fb367570a92ae88b0d3a4b1b8cd1#diff-a279c1f1078f9ed68984cf79e89d0eb5R22
And `ClassBody` and `StructBody` is merged into `AggregateBody`:
https://github.com/9rnsr/dlang.org/commit/0a4f7df5b31c8a1314cefef2c9d042af1c3ea01a