langtools/test/tools/javac/enum/FauxEnum3.java
author sogoel
Mon, 07 Jul 2014 12:36:45 -0700
changeset 25436 93247e8442a1
parent 5520 86e4b9a9da40
permissions -rw-r--r--
8046635: .out files for enum tests in tools/javac/dir Reviewed-by: jjg

/*
 * @test /nodynamiccopyright/
 * @bug 5009574
 * @summary verify an enum type can't be directly subclassed
 * @author Joseph D. Darcy
 *
 * @compile/fail/ref=FauxEnum3.out -XDrawDiagnostics  FauxEnum3.java
 */

public class FauxEnum3 extends SpecializedEnum {
}

enum SpecializedEnum {
    RED {
        boolean special() {return true;}
    },
    GREEN,
    BLUE;
    boolean special() {return false;}
}