Test(T)1template Test(T){ alias Type = T; } 2 3 alias X1 = int; 4 static assert(is(X1 == int)); 5 6 alias X2 = immutable(long)[], X3 = shared const double[int]; 7 static assert(is(X2 == immutable(long)[])); 8 static assert(is(X3 == shared const double[int])); 9 10 alias X4 = void delegate() const, X5 = Test!int; 11 static assert(is(X4 == void delegate() const)); 12 static assert(is(X5.Type == int)); 13 14 alias FP5 = extern(C) pure nothrow @safe @nogc void function(), 15 DG5 = extern(D) pure nothrow @safe @nogc void delegate(); 16 static assert(FP5.stringof == "extern (C) void function() pure nothrow " /* ~ "@safe " */ ~ "@nogc"); 17 static assert(DG5.stringof == "void delegate() pure nothrow " /* ~ "@safe " */ ~ "@nogc"); 18 main()19void main() 20 { 21 alias Y1 = int; 22 static assert(is(Y1 == int)); 23 24 alias Y2 = immutable(long)[], Y3 = shared const double[int]; 25 static assert(is(Y2 == immutable(long)[])); 26 static assert(is(Y3 == shared const double[int])); 27 28 alias Y4 = void delegate() const, Y5 = Test!int; 29 static assert(is(Y4 == void delegate() const)); 30 static assert(is(Y5.Type == int)); 31 32 /+ struct S 33 { 34 int value; 35 alias this = value; 36 } 37 auto s = S(10); 38 int n = s; 39 assert(n == 10); +/ 40 } 41