Bug 9679 – Refused const/immutable assignment in conditional
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-09T19:47:00Z
Last change time
2015-06-17T21:03:41Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
bearophile_hugs
Comments
Comment #0 by bearophile_hugs — 2013-03-09T19:47:16Z
void main() {
if (int x = 1) {} // OK
if (auto x = 1) {} // OK
if (const int x = 1) {} // OK
if (immutable int x = 1) {} // OK
if (const x = 1) {} // error
if (immutable x = 1) {} // error
}
dmd 2.063alpha:
test.d(6): Error: (arguments) expected following const(x)
test.d(7): Error: (arguments) expected following immutable(x)