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/16 17:22:00 UTC

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

Eric Milles created GROOVY-10497:
------------------------------------

             Summary: 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
            Reporter: Eric Milles


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)