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 2025/12/28 01:38:00 UTC

[jira] [Comment Edited] (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:comment-tabpanel&focusedCommentId=18047827#comment-18047827 ] 

Eric Milles edited comment on GROOVY-10702 at 12/28/25 1:37 AM:
----------------------------------------------------------------

https://github.com/apache/groovy/commit/af72676fda22f601c7197260b8df9bd17ff301a3
https://github.com/apache/groovy/commit/9b3eeb9e22da47c5650a187fcb8e1b23936321e5
https://github.com/apache/groovy/commit/2ac70b2db26cd2e0fdbfd63f57fb793cb872a3a3


was (Author: emilles):
https://github.com/apache/groovy/commit/af72676fda22f601c7197260b8df9bd17ff301a3
https://github.com/apache/groovy/commit/9b3eeb9e22da47c5650a187fcb8e1b23936321e5

> 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
>            Assignee: Eric Milles
>            Priority: Minor
>             Fix For: 6.0.0-alpha-1
>
>
> 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)