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/01/17 20:25:00 UTC

[jira] [Commented] (GROOVY-6182) Problem With getAt(Object)

    [ https://issues.apache.org/jira/browse/GROOVY-6182?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17477394#comment-17477394 ] 

Eric Milles commented on GROOVY-6182:
-------------------------------------

This is similar to GROOVY-6151 -- declared {{equals(Object)}} vs. extension {{equals(Map,Map)}}

As described in the first comment, if you provide an overload {{getAt(String)}} it will take precedence over the extension method with the same effective signature.  You can just delegate to your {{getAt(Object)}} in the body of the method to reduce duplication.

> Problem With getAt(Object)
> --------------------------
>
>                 Key: GROOVY-6182
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6182
>             Project: Groovy
>          Issue Type: Bug
>          Components: groovy-runtime
>    Affects Versions: 2.1.3
>            Reporter: Jeff Brown
>            Priority: Minor
>             Fix For: 4.x
>
>         Attachments: getat.zip
>
>
> getAt(Object) does not appear to be called when I do something like obj['someString'].  If I statically type the argument like getAt(String key), then it appears to work.  I am not sure if this is a bug or not.
> In the attached app run "./gradlew test".



--
This message was sent by Atlassian Jira
(v8.20.1#820001)