http://d.puremagic.com/issues/show_bug.cgi?id=4251
timon.g...@gmx.ch changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |timon.g...@gmx.ch Summary|Hole in the const system: |Hole in the type system: |immutable values can be |Base type reference can be |overwritten (const(T) is |assigned to subtype |appendable to const(T)[]) |reference (Super* is | |treated as a supertype of | |Sub*) --- Comment #16 from timon.g...@gmx.ch 2011-11-17 11:59:55 PST --- Class references have the same problem. class A{} class B:A{} void main(){ B x; A* y=&x; // bad! *y=new A; Object o = x; assert(o is x && o && is(typeof(x)==B) && !cast(B)o); } I have generalized the title accordingly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------