Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.1.6, 2.2.0-beta-1
-
None
Description
1. I wanted to define this very simple no-args closure, foo, using groovysh:
def foo = { ->
println "test"
}
2. But the moment I hit ENTER in the shell after typing out the first line,
I get the following error:
$ groovysh
Groovy Shell (2.1.5, JVM: 1.6.0_43)
Type 'help' or '\h' for help.
-----------------------------------------------------------------------------------
groovy:000> def foo = { ->
ERROR org.codehaus.groovy.control.MultipleCompilationErrorsException:
startup failed:
groovysh_parse: 2: unexpected token: -> @ line 2, column 13.
def foo = { ->
^
1 error
at java_lang_Runnable$run.call (Unknown Source)