1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/test/tools/javac/StringsInSwitch/BadlyTypedLabel1.java Mon Nov 02 21:36:59 2009 -0800 1.3 @@ -0,0 +1,17 @@ 1.4 +/* 1.5 + * @test /nodynamiccopyright/ 1.6 + * @bug 6827009 1.7 + * @summary Check for case labels of different types. 1.8 + * @compile/fail -source 6 BadlyTypedLabel1.java 1.9 + * @compile/fail/ref=BadlyTypedLabel1.out -XDstdout -XDrawDiagnostics BadlyTypedLabel1.java 1.10 + */ 1.11 +class BadlyTypedLabel1 { 1.12 + String m(String s) { 1.13 + switch(s) { 1.14 + case "Hello World": 1.15 + return(s); 1.16 + case 42: 1.17 + return ("Don't forget your towel!"); 1.18 + } 1.19 + } 1.20 +}