int value; /* ERRORS */ typedef; typedef a =; typedef b = while; typedef c = 0; typedef d = value; typedef e = value while; typedef f = int#[while]; typedef g = int:typedef; typedef h = value:; typedef arr = int#[3]; // try to use these corrupt typedefs var a x1 = 1; var b x2 = 1; var c x3 = 1; var d x4 = 1; var e x5 = 1; var f x6 = [1, 2, 3]; var g x7 = 1; () func() { x1 = x2; x2 = x3; x3 = x4; x4 = x5; x5 = x1; x6 = x6; x1 = 0; x2 = 0; x3 = 0; x4 = 0; x5 = 0; x6 = [1,2,3]; arr = x6; // ERROR x6 = arr; // ERROR x6#[0] = 1; int z1 = x1; int z2 = x2; int z3 = x3; int z4 = x4; int z5 = x5; int#[2] z6 = x6; int z7 = x7; } namespace Good { typedef here[T] = T^; // the type parameter should not be accessible from outside the type int dostuff(Good[T] this) { // this is allowed Broken[T] loophole; loophole->dostuff(); // "Broken" should be broken type, so no need to report an error here return 0; } } () good() { Good[int] xx; xx->dostuff(); } namespace NestTest { typedef here[T] = (T^, Inside[T]); namespace Inside { typedef here[T] = T^; int work(Inside[T] this); } } namespace BadNestTest { typedef here[T] = (T^, Inside[T]); namespace Inside { typedef here[U] = U^; int work(Inside[T] this); // ERROR type parameter from other type may not be accessed } } namespace Broken { typedef here[T] = T^; int dostuff(Broken[Good:T] this); // ERROR namespace qualified type parameters make no sense } () morebroken() { // The error about the broken function should appear // at the function definition and not here. Broken[int] xx; xx->dostuff(); /* ERRORS */ byte#[;} data; !byte#[3]^ dataptr = @data; }