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