Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.5.2
-
Component/s: None
-
Labels:None
-
Environment:Ubuntu 6.06 LTS Dapper Drake, JDK 1.5.0_05, Groovy Revision 3983
-
Number of attachments :
Description
The script:
class stringMethodName {
Integer 'flob' ( ) {
}
}
fails with the message:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, stringMethodName.groovy: 2: unexpected token: Integer @ line 2, column 3.
Integer 'flob' ( ) {
^
1 error
If any combination of modifiers is put before the Integer, for example:
class stringMethodName {
public Integer 'flob' ( ) {
}
}
then compilation is successful.
The following blow too
class StringMethodName { Integer 'flob'() {} def 'foo'() {} // blows private boolean 'fooBoolean'() { false } public int 'fooInt'() { 1 } public def 'fooDef'() {} }Seems like quoted method names only work for those methods that
a) have an access modifier
b) return a non-primitive, non-def value
class StringMethodName { Integer 'flob'() {} def 'foo'() {} // blows private boolean 'fooBoolean'() { false } public int 'fooInt'() { 1 } public def 'fooDef'() {} }