[ 
https://issues.apache.org/jira/browse/GROOVY-10180?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17505028#comment-17505028
 ] 

Eric Milles commented on GROOVY-10180:
--------------------------------------

https://github.com/apache/groovy/commit/39a3c7479d7d5a2af297e2be5a28bb2bc47e0da8

> STC: instanceof and DGM each(Map,Closure)
> -----------------------------------------
>
>                 Key: GROOVY-10180
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10180
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.5.14, 3.0.8, 4.0.0-alpha-3
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 4.0.0-beta-1
>
>
> Similar to GROOVY-10179, STC is not inferring the type of map entry through 
> instanceof.  Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test(args) {
>   if (args instanceof Map) {
>     args.each { e ->
>       println "$e.key $e.value"
>     }
>   }
> }
> test(a:1,b:2,c:3.14)
> {code}



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

Reply via email to