You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (JIRA)" <ji...@apache.org> on 2018/01/15 13:22:00 UTC

[jira] [Created] (GROOVY-8448) Local variable is accessible via explicit this

Daniil Ovchinnikov created GROOVY-8448:
------------------------------------------

             Summary: Local variable is accessible via explicit this
                 Key: GROOVY-8448
                 URL: https://issues.apache.org/jira/browse/GROOVY-8448
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 2.4.13
            Reporter: Daniil Ovchinnikov


{code:groovy}
def var = "local var"
new Runnable() {
  def getVar() { "getter" }
  void run() {
    println var // as expected: local var
    println this.var // expected: getter, actual: local var
  }
}.run()
{code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)