You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2022/02/03 22:35:01 UTC

[jira] [Closed] (GROOVY-5453) Incorrect resolve of category property for String

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

Paul King closed GROOVY-5453.
-----------------------------

> Incorrect resolve of category property for String
> -------------------------------------------------
>
>                 Key: GROOVY-5453
>                 URL: https://issues.apache.org/jira/browse/GROOVY-5453
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.0-rc-1
>            Reporter: Maxim Medvedev
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-beta-1, 3.0.9
>
>
> Assume you have two category methods with String and CharSequence as first parameters respectively. The bug is that Groovy prefers the 'CharSequence' method for String qualifier. 
> The bug is reproduced only for String and CharSequence types.
> Direct accessor invoking returns correct result.
> {code}
> class Cat {
>   static getFoo(String s) {'String'}
>   static getFoo(CharSequence s) {'CharSequence'}
> }
> use (Cat) {
>   assert 'abc'.getFoo() == 'String'   //works
>   assert 'abc'.foo      == 'String'   //fails
> }
> {code}



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