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 18:57:00 UTC
[jira] [Created] (GROOVY-10180) STC: instanceof and DGM
each(Map,Closure)
Eric Milles created GROOVY-10180:
------------------------------------
Summary: 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: 4.0.0-alpha-3, 3.0.8, 2.5.14
Reporter: Eric Milles
Assignee: Eric Milles
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)