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/02/19 16:28:00 UTC

[jira] [Resolved] (GROOVY-10497) NamedVariant: default value overrides supplied value if it's falsy

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

Eric Milles resolved GROOVY-10497.
----------------------------------
    Fix Version/s: 5.0.0-alpha-1
       Resolution: Fixed

> NamedVariant: default value overrides supplied value if it's falsy
> ------------------------------------------------------------------
>
>                 Key: GROOVY-10497
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10497
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.5.16, 3.0.10, 4.0.0
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Major
>              Labels: named-parameters
>             Fix For: 5.0.0-alpha-1
>
>          Time Spent: 1.5h
>  Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}
> @groovy.transform.NamedVariant
> def m(int one, int two = 42) {
>     "$one $two"
> }
> String result = m(one:0, two:0)
> assert result == '0 0' // fails
> {code}



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