Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.1-beta-1
-
Fix Version/s: 1.1-beta-2
-
Component/s: command line processing
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
The Groovy compiler gives a compile error for a static initialiser, unless the { appears on the same line as static...
In other words,
static {
// do something
}
compiles, but
static
{
// do something else
}
gives a compile error.
For example, the attached file gives a compile error:
$ groovy Test.groovy
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, Test.groovy: 3: unexpected token: static @ line 3, column 3.
static
^
1 error
Fixed in r6298.