Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.3
-
None
-
Mac OS X
Description
The following code works well dynamically, properly type checks, but fails static compilation:
@groovy.transform.CompileStatic test() {
def versionRanges = [['1.7', 11]]
versionRanges.collect { versionRange -> versionRange[1].collect { versionRange[0] } }.flatten()
}
test()
Exception thrown BUG! exception in phase 'class generation' in source unit 'ConsoleScript23' At line 3 column 45 On receiver: versionRange with message: getAt and arguments: 1 This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at http://jira.codehaus.org/browse/GROOVY
Although it's reported on the first versionRange[1], it's actually seems related to the second call (versionRange[0]). If you remove that second call, all is fine.