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/04/27 08:34:00 UTC
[jira] [Closed] (GROOVY-10528) STC: NPE for raw type instanceof followed by parameterized extension method
[ https://issues.apache.org/jira/browse/GROOVY-10528?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-10528.
------------------------------
> STC: NPE for raw type instanceof followed by parameterized extension method
> ---------------------------------------------------------------------------
>
> Key: GROOVY-10528
> URL: https://issues.apache.org/jira/browse/GROOVY-10528
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 4.0.1
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 5.0.0-alpha-1, 4.0.2
>
>
> Consider the following:
> {code:groovy}
> void test(... args) {
> args.each { object ->
> if (object instanceof Iterable) {
> object.each { test(it) }
> }
> }
> }
> test(1,[2,3])
> {code}
> The inferred type of "it" is causing NullPointerException at StaticTypeCheckingSupport.isAssignableTo(StaticTypeCheckingSupport.java:489)
--
This message was sent by Atlassian Jira
(v8.20.7#820007)