[
https://issues.apache.org/jira/browse/GROOVY-10477?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-10477.
----------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/999a81be1afeb8aff26b1cfe1c81dbd891c4b0e2
> 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: 5.0.0-alpha-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.1#820001)