[
https://issues.apache.org/jira/browse/GROOVY-10502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King updated GROOVY-10502:
-------------------------------
Description:
When adjusting NamedVariant to cater for its use (under the covers) for
records, a few anomalies were introduced. The first is fixed in GROOVY-10497.
This one covers a left over case for null.
{code:groovy}
@groovy.transform.NamedVariant
def m(int one, int two = 42) {
"$one $two"
}
String result = m(one:0, two:null)
assert result == '0 0' // fails
{code}
was:
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}
> NamedVariant: improve consistency of default value treatment
> ------------------------------------------------------------
>
> Key: GROOVY-10502
> URL: https://issues.apache.org/jira/browse/GROOVY-10502
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.0
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Labels: named-parameters
>
> When adjusting NamedVariant to cater for its use (under the covers) for
> records, a few anomalies were introduced. The first is fixed in GROOVY-10497.
> This one covers a left over case for null.
> {code:groovy}
> @groovy.transform.NamedVariant
> def m(int one, int two = 42) {
> "$one $two"
> }
> String result = m(one:0, two:null)
> assert result == '0 0' // fails
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)