-
Notifications
You must be signed in to change notification settings - Fork 0
/
tcombi.d
26 lines (22 loc) · 905 Bytes
/
tcombi.d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//pragma(msg, bar());
static assert(is(typeof([[[]],[[1]]]) == int[][][]));
pragma(msg, typeof([[[]],[[1]]]));
static assert(is(typeof(0?[[]]:[[1]]) == int[][]));
pragma(msg, typeof(0?[[]]:[[1]]));
static assert(is(typeof([[[]],[[]],[[1]]]) == int[][][]));
pragma(msg, typeof([[[]],[[]],[[1]]]));
static assert(is(typeof(1?1?[[]]:[[]]:[[1]]) == int[][]));
pragma(msg, typeof(1?1?[[]]:[[]]:[[1]]));
immutable(typeof([])) empty;
static assert(is(typeof([[empty],[[1]]]) == int[][][]));
pragma(msg,typeof([[empty],[[1]]]));
typeof([])[] emptyarr;
static assert(is(typeof([emptyarr,[[1]]])==const(int[])[][]));
pragma(msg, typeof([emptyarr,[[1]]]));
typeof(null)[] nullarray;
int*[]x;
static assert(is(typeof([nullarray,x])==const(int*)[][]));
pragma(msg, typeof([nullarray,x]));
immutable(int)*[]y;
static assert(is(typeof([nullarray,y])==const(immutable(int)*)[][]));
pragma(msg, typeof([nullarray,x]));