d: Merge upstream dmd, druntime 4c18eed967, phobos d945686a4.
[official-gcc.git] / gcc / testsuite / gdc.test / fail_compilation / hexstring.d
blobde83db9c5ed1bc37310435382a09616c8dcf3f77
1 /**
2 TEST_OUTPUT:
3 ---
4 fail_compilation\hexstring.d(16): Error: cannot implicitly convert expression `"123F"` of type `string` to `immutable(ubyte[])`
5 fail_compilation\hexstring.d(17): Error: cannot implicitly convert expression `"\x12?"c` of type `string` to `immutable(ubyte[])`
6 fail_compilation\hexstring.d(18): Error: cannot implicitly convert expression `"\x12?"` of type `string` to `immutable(ubyte[])`
7 fail_compilation\hexstring.d(15): Error: cannot implicitly convert expression `"\x12?"` of type `string` to `ubyte[]`
8 ---
9 */
10 immutable ubyte[] s0 = x"123F";
11 static assert(s0[0] == 0x12);
12 static assert(s0[1] == 0x3F);
13 immutable byte[] s1 = x"123F";
15 ubyte[] f1 = x"123F";
16 immutable ubyte[] f2 = "123F";
17 immutable ubyte[] f3 = x"123F"c;
18 immutable ubyte[] f4 = cast(string) x"123F";