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 2023/01/24 18:49:00 UTC

[jira] [Updated] (GROOVY-10915) DGM: class that provides isCase but not isNotCase

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

Eric Milles updated GROOVY-10915:
---------------------------------
    Component/s: groovy-jdk

> DGM: class that provides isCase but not isNotCase
> -------------------------------------------------
>
>                 Key: GROOVY-10915
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10915
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-jdk
>            Reporter: Eric Milles
>            Priority: Major
>
> Consider the following:
> {code:groovy}
> class C {
>   boolean isCase(value) {
>     // ...
>   }
> }
> {code}
> Static compilation of "x in c" and "!(x in c)" will use C's {isCase}} method.  However "x !in c" will use DGM.isNotCase() which static dispatches to DGM.isCase.  The isNotCase extension methods added in Groovy 4 should probably use invokeMethod to dynamic dispatch to make use of the "isCase" implemented by C.



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