[ 
https://issues.apache.org/jira/browse/GROOVY-10476?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Milles resolved GROOVY-10476.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

https://github.com/apache/groovy/commit/d6f7b4fc5f69c7e91ab5f21f3c90aed22120f63d

> STC: for-each loop on iterable-like types
> -----------------------------------------
>
>                 Key: GROOVY-10476
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10476
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 3.0.9, 4.0.0
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 5.0.0-alpha-1
>
>
> Follow up from GROOVY-8133.  Using a {{Stream}} or other iterable-like type 
> (provides {{iterator()}} method but does not implement {{Iterable}}) in a 
> for-each loop works but does not provide type inference beyond {{Object}} for 
> the loop element type.
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
>   for (e in ['a','b','c'].stream()) {
>     println e.toUpperCase()
>   }
> }
> {code}



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

Reply via email to