When doing casts on dynamic arrays, invalid casts (i.e. where the sizes of the source and destination arrays do not have a 0 remainder) are correctly diagnosed as an error: short[] x = [1]; int[] y = cast(int[])x; // error, array cast misalignment The equivalent operation performed on static arrays should be diagnosable at compile-time, but isn't: short[1] x = [1]; int[1] y = cast(int[1])x; // accepted, even though illegal writefln("%s", y[0]); // prints garbage
https://github.com/D-Programming-Language/dmd/pull/201
https://github.com/D-Programming-Language/dmd/commit/6f37208535a69a79474b52d9755c46921961e7e1 https://github.com/D-Programming-Language/dmd/commit/3abfaea0c0ad70369a3d1d446c394cb47f0ec55a
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル