Bug 6162 – Remove "invariant" as alias for "immutable"

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-06-15T13:37:00Z
Last change time
2011-12-12T03:55:23Z
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-06-15T13:37:33Z
In DMD 2.053 this code compiles with no errors, because "invariant" is an alias for "immutable" still: void main() { invariant x = 10; } But I suggest to remove this alias soon because it causes me some troubles regarding Class/struct/enum invariants. DMD v2.053 compiles this with no errors: struct Foo { invariant {} } struct Bar { invariant } class CFoo { invariant {} } class CBar { invariant } void main() {} See bug 4325 for more info.
Comment #1 by k.hara.pg — 2011-12-12T02:45:10Z