Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
Description
Consider the following:
@groovy.transform.CompileStatic void test() { def list = [1, 2, 3, 4] Number[] array = list println array } test()
Groovy supports the implicit conversion "array = list" under STC/SC as of GROOVY-10002 and GROOVY-8983. Can the static compilation mode replace the call to DefaultTypeTransformation#castToType with a direct call to the collection's toArray() or toArray(T[])?
Attachments
Issue Links
- relates to
-
GROOVY-11309 Optimise bytecode for empty list expressions
- Closed