Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.4
-
None
-
None
Description
Combining a chain of spread-based calls in a method marked as CompileStatic seems to generate that won't pass verification.
package bug import groovy.transform.CompileStatic class Main2 { @CompileStatic static void main(String[] args) { def List<File> files = [] def urls = files*.toURI()*.toURL() println "OK!" } } Main2.main()
The code above fails with:
Caught: java.lang.VerifyError: (class: bug/Main2, method: main signature: ([Ljava/lang/String;)V) Inconsistent stack hei ght 3 != 2 java.lang.VerifyError: (class: bug/Main2, method: main signature: ([Ljava/lang/String;)V) Inconsistent stack height 3 != 2 at bug.test2.run(test2.groovy:14)
Removing the second use of the spread operator, or replacing any of the occurrences with a use of collect works around the issue.