Why don't my groovy enums work, or even compile?
Posted
by ?????
on Stack Overflow
See other posts from Stack Overflow
or by ?????
Published on 2010-03-07T04:27:46Z
Indexed on
2010/03/12
16:17 UTC
Read the original article
Hit count: 188
I'm running Groovy Version: 1.7.0 JVM: 1.6.0_17
(Update -- I just upgraded to 1.7.1 and get the same errors!)
I've tried to use enums, using the exact syntax from the groovy documentation, and each time I see the compile error:
Groovy:The class java.lang.Enum refers to the class java.lang.Enum and uses 1 parameters, but the referred class takes no parameters
Any ideas on what's going on?
For example: This code won't compile or run, and gets the error above.
enum VehicleStatus { OFF, IDLING, ACCELERATING, DECELARATING }
class Vehicle
{
Long id
Long version
VehicleStatus status
}
© Stack Overflow or respective owner