This code compiles, because the [0,0] dynamic array literal casts implicitly to int[2]: int[2] foo() { return [0, 0]; // OK } void main() {} And of course this too compiles: int[2] bar() { int[2] ab; return (true) ? ab : ab; // OK } void main() {} But currently this code doesn't compile: int[2] spam() { int[2] ab; return (true) ? ab : [0, 0]; // Error } void main() {} DMD 2.058head: test.d(3): Error: cannot implicitly convert expression (cast(int[])ab) of type int[] to int[2u] I think this isn't good.
https://github.com/D-Programming-Language/dmd/pull/618
https://github.com/D-Programming-Language/dmd/commit/61d4b884ca82933c759195492cb91086f8d2fba1 https://github.com/D-Programming-Language/dmd/commit/d1d5f8ef7c39d0a82aa55bde61152210aaf4f370
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル