[
https://issues.apache.org/jira/browse/GROOVY-11856?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-11856.
----------------------------------
Fix Version/s: 5.0.5
Resolution: Fixed
https://github.com/apache/groovy/commit/85a9f8e6a382c2b7f55f6615464c15b1c1d5ce21
> 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)