groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "death lord (JIRA)" <j...@apache.org>
Subject [jira] [Created] (GROOVY-8707) += in CompileStatic dynamically sets property instead of using setter
Date Fri, 20 Jul 2018 13:11:00 GMT
death lord created GROOVY-8707:
----------------------------------

             Summary: += 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


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
(v7.6.3#76005)

Mime
View raw message