Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.0
-
Fix Version/s: 1.7.1, 1.8-beta-1
-
Component/s: None
-
Labels:None
-
Environment:Mac OS X
-
Number of attachments :
Description
enum Color { RED { { println("foo"); } // Instance initalizer },GREEN,BLUE }
makes an error like:
$ groovy enumtest.groovy org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /Users/uehaj/src/groovy/enumtest.groovy: -1: You are not allowed to overwrite the final method $INIT([Ljava.lang.Object;) from class 'Color'. @ line -1, column -1. 1 error
following is OK.
num Color {
RED {
String toString() {}
{ println("foo"); } // Instance initalizer
},GREEN,BLUE
}
Activity
Roshan Dawrani
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Assignee | Roshan Dawrani [ roshandawrani ] |
Roshan Dawrani
made changes -
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 1.7.1 [ 16014 ] | |
| Fix Version/s | 1.8-beta-1 [ 16013 ] | |
| Status | Open [ 1 ] | Resolved [ 5 ] |
Paul King
made changes -
| Status | Resolved [ 5 ] | Closed [ 6 ] |