Assume the following code:
enum Color {
RED,
GREEN,
BLUE
enum Type {
RGBA,
RGB,
BGR
}
String getHex() {
return "#F00"
}
Type getType() {
return Type.RGB
}
}
println Color.RED.type.name()
I thought that nested ones are enumpossible, but if you try to run this piece of code using groovy (using 2.4.13), it seems like it loops forever and never executes or compiles it.
If I put enum Typeoutside, it works fine.
Why is this happening? Are there any links explaining why this fails?
source
share