Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.5.4
-
Fix Version/s: 1.5.5, 1.6-beta-1
-
Component/s: Groovysh
-
Labels:None
-
Environment:Windows XP
-
Number of attachments :
Description
This expression works properly in Groovy console, but it does not work
in groovysh:
[1,2,3] as Object[]
In groovysh it throws exception:
ERROR groovy.lang.MissingMethodException: No signature of method:
org.codehaus.groovy.tools.shell.Groovysh$_cl
osure1.call() is applicable for argument types: (java.lang.Integer,
java.lang.Integer, java.lang.Integer) valu
es: {1, 2, 3}
However,
[1,2,3] as int[]
works as expected.
[1,2,3] as Integer[]
throws similar exception.
All these expressions work properly in Groovy console.
I'm sure this is because groovysh has some magic in it to try and allow for line by line parsing, where groovyConsole parses full/complete source buffers... not sure how to fix really, we can add more hacks to allow groovysh to behave better, but its just a bandaid.