[
https://issues.apache.org/jira/browse/GROOVY-11856?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King closed GROOVY-11856.
------------------------------
> Compiler writes extra cast for method call on list expression
> -------------------------------------------------------------
>
> Key: GROOVY-11856
> URL: https://issues.apache.org/jira/browse/GROOVY-11856
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.5
>
>
> Consider the following:
> {code:groovy}
> @CompileStatic
> def test() {
> ["x"].toArray(new String[0])
> }
> {code}
> After {{INVOKESTATIC
> org/codehaus/groovy/runtime/ScriptBytecodeAdapter.createList}} the compiler
> writes an {{INVOKEDYNAMIC cast}} from {{List}} to {{ArrayList}}. STC knows
> the type of list is already an {{ArrayList}}.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)