You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/07/23 22:45:00 UTC
[jira] [Resolved] (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 ]
Eric Milles resolved GROOVY-10180.
----------------------------------
Fix Version/s: 4.0.0-beta-1
Resolution: Fixed
> 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.3.4#803005)