Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
Ubuntu 7.04 Feisty Fawn + Groovy SVN HEAD
Description
if the script:
data = [ 3 , 4 , 5 ] doSomething = { i -> println ( i ) } data.each doSomething
is in a file named doSomething.groovy then the resulting error message is:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, doSomething.groovy: 2: you tried to assign a value to doSomething
@ line 2, column 1.
doSomething =
^
1 error
this is not particularly informative. The "error" is actually that the script is called doSomething.groovy so the generated class will be called doSomething and so it is not possible to put a varaible of this name into the binding. So the message should be something like: "The script is called doSomething so it is not possible to have variables of that name in the binding."