[
https://issues.apache.org/jira/browse/GROOVY-10477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-10477:
---------------------------------
Fix Version/s: (was: 5.0.0-alpha-1)
> SC: optimize for-in loop on array 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
> Priority: Major
> Fix For: 2.5.16, 3.0.10, 4.0.1
>
>
> 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.10#820010)