Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
I am getting a
Exception in thread "main" java.lang.IllegalArgumentException: array is not of length 1
To reproduce, compile the following in Groovy 2.5 with
groovyOptions.optimizationOptions.indy = true
package first class Library { def foo(a, b= '<1>', c= '<2>') { "$a" + b + c } def methodMissing(String name, args) { foo(name, *args[1..<args.size()]) } }
Then reference the code in Groovy 3.0.5 to reproduce the error
package second import first.Library class App { static void main(String[] args) { println new Library().bar( 'a' ) println new Library().bin( 'a', 'b') } }
Note that if both are compiled with Groovy2 or Groovy3 the error does not occur.
This is probably similar to https://issues.apache.org/jira/browse/GROOVY-9515?jql=text%20~%20%22%5C%22array%20is%20not%20of%20length%201%5C%22%22