langtools/test/tools/javac/enum/EnumSwitch2.java
author jjg
Wed, 29 Oct 2014 17:25:23 -0700 (2014-10-30)
changeset 27319 030080f03e4f
parent 25309 dcd9a7e19669
child 29430 0fc887a8c519
permissions -rw-r--r--
8062348: langtools tests should close file manager (group 1) Reviewed-by: darcy
/*
 * @test /nodynamiccopyright/
 * @bug 4936393
 * @summary enum switch case labels required to be unqualified.
 * @author gafter
 * @compile/fail/ref=EnumSwitch2.out -XDrawDiagnostics EnumSwitch2.java
 */

enum E1 { a, b, c, d, e }

class EnumSwitch2 {
    void f(E1 e1) {
        switch (e1) {
        case E1.a:
        case E1.d:
        default:
            break;
        }
    }
}