You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:35:01 UTC
[jira] [Closed] (GROOVY-10180) STC: instanceof and DGM each(Map,Closure)
[ https://issues.apache.org/jira/browse/GROOVY-10180?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-10180.
------------------------------
> 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)