1 /* 2 REQUIRED_ARGS: -m32 3 TEST_OUTPUT: 4 --- 5 fail_compilation/test15703.d(16): Error: cast from `Object[]` to `uint[]` not allowed in safe code 6 fail_compilation/test15703.d(18): Error: cast from `object.Object` to `const(uint)*` not allowed in safe code 7 fail_compilation/test15703.d(21): Error: cast from `uint[]` to `Object[]` not allowed in safe code 8 --- 9 */ 10 11 // https://issues.dlang.org/show_bug.cgi?id=15703 12 test()13void test() @safe 14 { 15 auto objs = [ new Object() ]; 16 auto longs = cast(size_t[]) objs; // error 17 auto longc = cast(const(size_t)[]) objs; // ok 18 auto longp = cast(const(size_t)*) objs[0]; // error 19 20 size_t[] al; 21 objs = cast(Object[]) al; // error 22 23 auto am = cast(int[])[]; 24 } 25 test2()26void test2() @safe 27 { 28 const(ubyte)[] a; 29 auto b = cast(const(uint[])) a; 30 } 31 32