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 2021/11/19 16:55:00 UTC

[jira] [Updated] (GROOVY-7370) Varargs in constructor are not treated correctly when creating instances of anonymous class

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

Eric Milles updated GROOVY-7370:
--------------------------------
    Labels: varargs  (was: )

> Varargs in constructor are not treated correctly when creating instances of anonymous class
> -------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-7370
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7370
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Nikita Artyushov
>            Priority: Major
>              Labels: varargs
>
> Code snippet to reproduce the bug:
> {code}
> class Test {
>     public Test(String... args) {
>         println args
>     }
>     public static void main(String[] args) {
>         new Test('oneWord')
>         new Test('manyLetters') {
>             @Override
>             int hashCode() {
>                 return 1;
>             }
>         }
>     }
> }
> {code}
> expected output:
> {code}
> [oneWord]
> [manyLetters]
> {code}
> actual:
> {code}
> [oneWord]
> [m, a, n, y, L, e, t, t, e, r, s]
> {code}



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