You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2016/10/24 13:16:58 UTC

[jira] [Created] (GROOVY-7973) Class.this not evaluated correctly within a closure within an inner class

Paul King created GROOVY-7973:
---------------------------------

             Summary: Class.this not evaluated correctly within a closure within an inner class
                 Key: GROOVY-7973
                 URL: https://issues.apache.org/jira/browse/GROOVY-7973
             Project: Groovy
          Issue Type: Bug
            Reporter: Paul King


There is an incorrect calculation of 'this' within a closure within a nested class (an AIC is shown but a normal inner class exhibits the same behavior):
{code}
class Test {
  def foo() { println this }
  def bar() { new Object() { def inner() { println Test.this } } }
  def baz() { new Object() { def inner() { ''.with{ println Test.this } } } }
}

def t = new Test()
t.foo()          // Test@8bcf778
t.bar().inner()  // Test@8bcf778
t.baz().inner()  // Test$2$_inner_closure1@20c708ba
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)