Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.0-beta-8
-
None
-
None
-
Debian GNU/Linux testing with Sun JDK1.5
Description
The script:
#!/usr/bin/env groovy
println()
works fine. However the script:
#! /usr/bin/env groovy
testList = [ 1, 2, 3, 4, 5 ]
testList.each { test |
println()
}
fails with the message:
Caught: groovy.lang.GroovyRuntimeException: Could not find which method to invoke from this list: [org.codehaus.groovy.runtime.NewInstanceMetaMethod@94884d[name: println params: [class java.lang.Object, class java.lang.Object] returns: void owner: class org.codehaus.groovy.runtime.DefaultGroovyMethods], org.codehaus.groovy.runtime.NewInstanceMetaMethod@84da23[name: println params: [class java.lang.Object, class java.io.PrintWriter] returns: void owner: class org.codehaus.groovy.runtime.DefaultGroovyMethods]] for arguments: []
at trial$_run_closure1.doCall(/home/users/russel/Progs/Groovy/BugTests/./trial.groovy:6)
at trial.run(/home/users/russel/Progs/Groovy/BugTests/./trial.groovy:5)
at trial.main(/home/users/russel/Progs/Groovy/BugTests/./trial.groovy)
using println("") sort of cures the problem.