Community
Participate
Working Groups
Build 3.0M7 1.4 compliant compilers should reject the following code: class X { public static void main(String[] args) { switch(args.length) { case 1: class Local { } break; case 0 : System.out.println(new Local()); // Local undefined } } }
Javac 1.4.1, Jikes 1.18 do tolerate this code as we do.
Interestingly enough, the spec still allows the variable 'i' to be seen across switch case blocks... only a definite assignment issue is raised. The name can be resolved. class X { public static void main(String[] args) { switch(args.length) { case 1: int i = 0; break; case 0 : System.out.println(i); } } }
Fixed, added regression tests: Compliance13/Compliance14#test073 & test074
Verified in build I200403240800.