[Issue 7968] Failing implicit cast, new in 2.059

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Apr 23 10:56:19 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7968



--- Comment #3 from timon.gehr at gmx.ch 2012-04-23 10:57:19 PDT ---
(In reply to comment #2)
> How does the cast I attempted break the const model?

Having it be valid code allows to get a mutable reference to immutable data.
This reference can then be used to (attempt to) modify the immutable data. You
can refer to my first post for the counter-example.

It is an instance of the more general rule that mutable field arrays cannot be
covariant and type safe without runtime checks on every store to (or load from)
one of their array fields.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list