I just noticed that

void foo() @safe pure nothrow
{
    void[] void_array = new void[3];
    auto ubyte_array = cast(ubyte[])void_array;
    auto short_array = cast(short[])void_array;
}

compiles but gives a

object.Error@(0): array cast misalignment

because of the

    cast(short[])

I'm surprised---why is cast between different alignments and element lengths allowed at all in Safe D?

IMO, cast(ubyte[]), should be safe here though.

Reply via email to