aoqi@0: /* aoqi@0: * @test /nodynamiccopyright/ aoqi@0: * @bug 6827009 aoqi@0: * @summary Check for case labels of different types. aoqi@0: * @compile/fail -source 6 BadlyTypedLabel1.java aoqi@0: * @compile/fail/ref=BadlyTypedLabel1.out -XDrawDiagnostics BadlyTypedLabel1.java aoqi@0: */ aoqi@0: class BadlyTypedLabel1 { aoqi@0: String m(String s) { aoqi@0: switch(s) { aoqi@0: case "Hello World": aoqi@0: return(s); aoqi@0: case 42: aoqi@0: return ("Don't forget your towel!"); aoqi@0: } aoqi@0: } aoqi@0: }