Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.6
-
None
Description
When using spread-dot operator on an array in @CompileStatic annotated method the following error is raised:
BUG! exception in phase 'instruction selection' in source unit 'ConsoleScript9' unexpected NullpointerException
Caused by: java.lang.NullPointerException
Reproducible example:
import groovy.transform.CompileStatic @CompileStatic def foo() { new File("/").listFiles()*.name } foo()
The problem doesn't occur when the operator is used on a list:
import groovy.transform.CompileStatic @CompileStatic def foo() { new File("/").listFiles().toList()*.name } foo()