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 2022/07/23 16:26:00 UTC
[jira] [Updated] (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 ]
Eric Milles updated GROOVY-10528:
---------------------------------
Fix Version/s: (was: 5.0.0-alpha-1)
> 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: 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.10#820010)