Bug 8977 – Ability to break typesystem with static struct initializer (e.g. modify immutable)

Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-08T05:07:00Z
Last change time
2013-07-10T08:30:41Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
verylonglogin.reg
Blocks
2573

Comments

Comment #0 by verylonglogin.reg — 2012-11-08T05:07:36Z
The problem is `S s = <qualifier> S(<args>);` always allowed even if `<qualifier> S` isn't implicitly convertible to `S`: --- struct S { int* p; } void main() { immutable int* p; S s = immutable S(p); assert(s.p is p); *s.p = 1; } ---
Comment #1 by maxim — 2013-07-10T08:30:41Z
It was fixed in 2.063 release.