[
https://issues.apache.org/jira/browse/GROOVY-8707?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-8707:
--------------------------------
Fix Version/s: 2.5.16
> += in CompileStatic dynamically sets property instead of using setter
> ---------------------------------------------------------------------
>
> Key: GROOVY-8707
> URL: https://issues.apache.org/jira/browse/GROOVY-8707
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.1
> Reporter: death lord
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 4.0.0-alpha-1, 3.0.1, 2.5.16
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Code:
> {code:groovy}
> import groovy.transform.CompileStatic
> @CompileStatic
> class A {
> int num
> static main(args) {
> def a = new A()
> a.num = 5
> a.num += 10
> }
> }
> {code}
> Main method compiles to:
> {code}
> A a = new A();
> byte var2 = 5;
> a.setNum(var2);
> Object var10001 = null;
> ScriptBytecodeAdapter.setProperty(a.getNum() + 10, (Class)null, a,
> (String)"num");
> {code}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)