jdk-24/test/langtools/tools/javac/UseEnum.java

23 lines
488 B
Java
Raw Normal View History

2007-12-01 00:00:00 +00:00
/*
* @test /nodynamiccopyright/
2007-12-01 00:00:00 +00:00
* @bug 5013488
* @summary Compiler AssertionError: com.sun.tools.javac.util.Bits.incl(Bits.java:73)
*
* @compile/fail/ref=UseEnum.out -XDrawDiagnostics UseEnum.java
2007-12-01 00:00:00 +00:00
*/
import static java.lang.System.out;
class UseEnum {
enum Animal {cat, dog, bird, fish};
public static void meth() {
2007-12-01 00:00:00 +00:00
Animal pet;
pet = Animal.cat;
out.println(pet);
for (Animal beast : beast.values())
out.println(pet);
}
}