Problem Declaring Enum in Groovy Class

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem Declaring Enum in Groovy Class

Jason Rudolph
I'm trying to define an enumerated type within a Groovy class, but I get an error complaining about "Unknown type: ENUM_DEF". 

I have a simple file named Foo.groovy with the following contents:

class Foo {
    enum Bar {A, B, C}
}

When I run groovyc on this file, I get the following error:

> groovyc Foo.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Foo.groovy: 2: Unknown type: ENUM_DEF at line: 2 column: 5. File: Foo.groovy @ line 2, column 5.
       enum Bar {A, B, C}
       ^

1 error

Any thoughts on how I can resolve this error?  Any help you can offer is appreciated.

Thanks,
Jason

Reply | Threaded
Open this post in threaded view
|

Re: Problem Declaring Enum in Groovy Class

Jason Rudolph
All apologies.  I see that enum support is slated for Groovy 2.0.  


Cheers,
Jason


On Sep 10, 2006, at 2:58 PM, Jason Rudolph wrote:

I'm trying to define an enumerated type within a Groovy class, but I get an error complaining about "Unknown type: ENUM_DEF". 

I have a simple file named Foo.groovy with the following contents:

class Foo {
    enum Bar {A, B, C}
}

When I run groovyc on this file, I get the following error:

> groovyc Foo.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Foo.groovy: 2: Unknown type: ENUM_DEF at line: 2 column: 5. File: Foo.groovy @ line 2, column 5.
       enum Bar {A, B, C}
       ^

1 error

Any thoughts on how I can resolve this error?  Any help you can offer is appreciated.

Thanks,
Jason