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/22 13:29:00 UTC

[jira] [Updated] (GROOVY-10702) STC no error for multiple instanceof and sparse method call

     [ https://issues.apache.org/jira/browse/GROOVY-10702?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-10702:
---------------------------------
    Affects Version/s:     (was: 4.0.4)

> STC no error for multiple instanceof and sparse method call
> -----------------------------------------------------------
>
>                 Key: GROOVY-10702
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10702
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static compilation, Static Type Checker
>            Reporter: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked void test(o) {
>   o instanceof Map || o instanceof List ? o.entrySet() : null
> }
> {code}
> "entrySet" is available from {{Map}} but not from {{List}}, so the expectation is a STC error to guard against the MissingMethodException for STC or ClassCastException for SC when a list is given.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)