https://issues.dlang.org/show_bug.cgi?id=16357
Issue ID: 16357 Summary: cast(T[])[x] casts x to T instead of [x] to T[] Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: wrong-code Severity: normal Priority: P3 Component: dmd Assignee: nob...@puremagic.com Reporter: thecybersha...@gmail.com ////////////// test.d ////////////// void main() { uint x; ubyte[] data = cast(ubyte[])[x]; assert(data.length == 4); } //////////////////////////////////// This is surprising, because if the expression is split up into: auto arr = [x]; ubyte[] data = cast(ubyte[])arr; then the result is as expected (an array with 4 elements). --