Eric Milles created GROOVY-11856:
------------------------------------

             Summary: 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


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)

Reply via email to