Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.7.3
-
Fix Version/s: 1.7.4, 1.8-beta-1
-
Component/s: Compiler
-
Labels:None
-
Number of attachments :
Description
The following code compiles in 1.7.2, but not in 1.7.3:
private enum EnumWithToString { VALUE String toString() { "I'm a value" } }
groovyc output:
unexpected token: VALUE @ line 337, column 3.
VALUE
^
1 error
The compile error goes away when adding a semicolon after "VALUE".
Looks to be caused by r19830 (on groovy.g) - changes made for
GROOVY-3986andGROOVY-3047.If I revert that change, the given example compiles fine again.
I suspect that in particular, it is due to
GROOVY-3047(enum definition does not allow trailing comma), but I can't be sure as fixes for 2 JIRAs are combined in the same revision (which I wish weren't but may be they were too inter-dependent).Anyway we seem to have the regression r19830 onwards.