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:32:00 UTC
[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17493378#comment-17493378 ]
Eric Milles commented on GROOVY-10497:
--------------------------------------
https://github.com/apache/groovy/pull/1687
> 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: 4.0.0
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Labels: named-parameters
> Time Spent: 20m
> 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)