Eric Milles created GROOVY-10477:
------------------------------------

             Summary: SC: optimize for-each loop with dynamic variable
                 Key: GROOVY-10477
                 URL: https://issues.apache.org/jira/browse/GROOVY-10477
             Project: Groovy
          Issue Type: Improvement
            Reporter: Eric Milles
            Assignee: Eric Milles


Consider the following:
{code:groovy}
@groovy.transform.CompileStatic
void test(String[] strings) {
  for (string in strings) {
    // ...
  }
}
{code}

This code does not write an optimized array-based iteration since the type of 
"string" isn't explicitly declared. "for (String string in strings)" and "for 
(String string : strings)" are so optimized.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to