[jira] [Resolved] (GROOVY-8150) Inconsistency in multiple assignment with single variable
[ https://issues.apache.org/jira/browse/GROOVY-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Paul King resolved GROOVY-8150. --- Resolution: Fixed Fix Version/s: (was: 3.0) 2.6.0-alpha-1 > Inconsistency in multiple assignment with single variable > - > > Key: GROOVY-8150 > URL: https://issues.apache.org/jira/browse/GROOVY-8150 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.0-alpha-1, 2.4.10 >Reporter: Daniil Ovchinnikov >Assignee: Daniel Sun > Fix For: 2.6.0-alpha-1 > > > {code} > def a > def b = [1] > a = b > println "${a} : ${a.class}" // [1] : class java.util.ArrayList > (a) = b > println "${a} : ${a.class}" // 1 : class java.lang.Integer > ((a)) = b > println "${a} : ${a.class}" // [1] : class java.util.ArrayList > {code} > This is confusing. Here are options: > 1. {{((a)) = b}} should be failed to parse. > 2. {{((a)) = b}} should behave like {{(a) = b}}, i.e. number of parentheses > should not matter. > 3. {{((a)) = b}} and {{(a) = b}} should behave like {{a = b}}. This will > match the following case also: > {code} > class A { def myField } > def a = new A() > def b = [1] > a.myField = b > assert a.myField == [1] > (a.myField) = b > assert a.myField == [1] > ((a.myField)) = b > assert a.myField == [1] > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Resolved] (GROOVY-8150) Inconsistency in multiple assignment with single variable
[ https://issues.apache.org/jira/browse/GROOVY-8150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Daniel Sun resolved GROOVY-8150. Resolution: Fixed Fix Version/s: 3.0 Fixed by https://github.com/apache/groovy/commit/23c6cdc6902df8ff58a85e286517b58473d0 Thanks for your reporting the issue :) > Inconsistency in multiple assignment with single variable > - > > Key: GROOVY-8150 > URL: https://issues.apache.org/jira/browse/GROOVY-8150 > Project: Groovy > Issue Type: Bug >Affects Versions: 2.5.0-alpha-1, 2.4.10 >Reporter: Daniil Ovchinnikov >Assignee: Daniel Sun > Fix For: 3.0 > > > {code} > def a > def b = [1] > a = b > println "${a} : ${a.class}" // [1] : class java.util.ArrayList > (a) = b > println "${a} : ${a.class}" // 1 : class java.lang.Integer > ((a)) = b > println "${a} : ${a.class}" // [1] : class java.util.ArrayList > {code} > This is confusing. Here are options: > 1. {{((a)) = b}} should be failed to parse. > 2. {{((a)) = b}} should behave like {{(a) = b}}, i.e. number of parentheses > should not matter. > 3. {{((a)) = b}} and {{(a) = b}} should behave like {{a = b}}. This will > match the following case also: > {code} > class A { def myField } > def a = new A() > def b = [1] > a.myField = b > assert a.myField == [1] > (a.myField) = b > assert a.myField == [1] > ((a.myField)) = b > assert a.myField == [1] > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)