http://d.puremagic.com/issues/show_bug.cgi?id=10573
--- Comment #3 from Daniel Kozak <[email protected]> 2013-07-08 23:20:16 PDT --- (In reply to comment #2) > Btw, I'd be very careful using casts on hashes like that, there's no runtime > checking when you cast hashes, even if the key or value is a base class which > is casted to a derived class. For example: > > ----- > class A { } > class B : A { void call() { } } > > void main() > { > A[int] a; > a[1] = new A(); > > B[int] b = cast(B[int])a; // unsafe, no exceptions thrown > b[1].call(); // crash > } > ----- Yes, I realize I can avoid this kind of cast in my case, so now the code is more safe and compilable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
