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 2023/02/03 17:18:00 UTC
[jira] [Resolved] (GROOVY-10919) @MapConstructor Breaks in Groovy4 when combined with @TupleConstructor, fine in Groovy3
[ https://issues.apache.org/jira/browse/GROOVY-10919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-10919.
----------------------------------
Resolution: Fixed
https://github.com/apache/groovy/commit/e18e8923e973614e30107f084a0033311f5e8b39
> @MapConstructor Breaks in Groovy4 when combined with @TupleConstructor, fine in Groovy3
> ---------------------------------------------------------------------------------------
>
> Key: GROOVY-10919
> URL: https://issues.apache.org/jira/browse/GROOVY-10919
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 4.0.8
> Reporter: Aleks Tamarkin
> Assignee: Eric Milles
> Priority: Major
>
> @MapConstructor Breaks in Groovy4 when combined with @TupleConstructor, fine in Groovy3
>
> Example in Groovy4
> {code:java}
> import groovy.transform.*
> @MapConstructor(includeFields = true)
> @TupleConstructor(includeFields = true)
> @ToString(includeNames = true, includeFields = true)
> class Foo {
> private final float w = 1
> private final int x
> private int y = 1
> private final int z
> }
> println new Foo(x:2, z: 3){code}
> outputs the incorrect value
> {code:java}
> Foo(x:2, y:0, z:3){code}
> In Groovy3 it outputs the correct
> {code:java}
> Foo(x:2, y:1, z:3){code}
> Also commenting out @TupleConstructor in Groovy4 causes the output to be the correct value.
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)