/* ERRORS; Named type & named type => identity comparison */ int a = tt; T b = ii; /* ERRORS: Named & anonymous types => structure comparison */ () c = ii; U d = tt; V e = (); /* ERRORS */ int^ f = @b; T^ g = @a; /* ERRORS */ ()^ h = @a; (RT1 x) i = h^; (RT2 x) j = i; byte^ k = @u16; uint16^ l = @byt; /* ERRORS byte and char require explicit "as uint8" expressions */ byte^ bp1 = @ch; char^ cp1 = @byt; byte^ bp1 = charp; char^ cp1 = bytep; /* ERRORS structurally incompatible enums */ enum(true=0,false=1) k1 = bb; int enum(false=4,true=0) k2 = bb; int enum(false=0,nottrue=1) k3 = bb; int enum(false=0,true=5) k4 = bb; int enum(false=0) k5 = bb; /* ERRORS: Function types */ FT1^ fp1 = @fun; FT2^ fp2 = fp1; (short)#[2] arr1 = [(1,), (2,)]; /* ERRORS: structure of array element types must match exactly */ (int)#[2] arr2 = arr1; // types to test with typedef T = (); typedef U = (); typedef TPtr = T^; // bad code style! typedef UPtr = U^; typedef V = (int x); typedef W = (int x, int y); typedef RT1 = (T x); typedef RT2 = (T x); typedef FT1 = T(T a, T b); typedef FT2 = T(T a, T b); // values to test with int ii = 0; T tt = (); bool bb = :false; byte byt = 10; char ch = 32; byte^ bytep = @byt; char^ charp = @ch; uint16 u16 = 1234; // functions to test with T fun(T x, () y);