You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2019/09/23 15:57:00 UTC

[jira] [Updated] (GROOVY-9256) trait qualified-super expressions fail when inside closure

     [ https://issues.apache.org/jira/browse/GROOVY-9256?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Eric Milles updated GROOVY-9256:
--------------------------------
    Description: 
Consider the following:
{code:groovy}
trait T {
  String string = 'value'
}

class C implements T {
  void meth() {
    { ->
      T.super.setString('other')
      println T.super.getString()
    }()
  }
}

new C().meth()​
{code}

The addition of a closure within the method causes a breakdown of the qualified-super method or property access.  "MissingPropertyException: No such property: super for class: T"

  was:
Consider the following:
{code:groovy}
trait T {
  String string = 'value'
}

class C implements T {
  void meth() {
    { ->
      T.super.setString('other')
      println T.super.getString()
    }()
  }
}

new C().meth()​
{code}

The addition of a closure within the method causes a breakdown of the qualified-super method or property access.


> trait qualified-super expressions fail when inside closure
> ----------------------------------------------------------
>
>                 Key: GROOVY-9256
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9256
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
> trait T {
>   String string = 'value'
> }
> class C implements T {
>   void meth() {
>     { ->
>       T.super.setString('other')
>       println T.super.getString()
>     }()
>   }
> }
> new C().meth()​
> {code}
> The addition of a closure within the method causes a breakdown of the qualified-super method or property access.  "MissingPropertyException: No such property: super for class: T"



--
This message was sent by Atlassian Jira
(v8.3.4#803005)