On Wed, 10 Feb 2016 21:40:21 +0000, Iakh wrote: > On Wednesday, 10 February 2016 at 20:14:29 UTC, Chris Wright wrote: >> @safe protects you from segmentation faults and reading and writing >> outside an allocated segment of memory. With array casts, @safety is >> assured > > Yes, @safe protects from direct cast to/from ref types but there still > is a trick with T[] -> void[] -> T2[] cast: > > So no safety in this world.
Okay, that's a problem. It should always be safe to cast from void[] to immutable(T)[] where T doesn't contain pointers. I didn't see a bug for this, so I'm filing it.
