Björn Kautler created GROOVY-12470:
--------------------------------------

             Summary: SC: super-method calls do not work under static 
compilation
                 Key: GROOVY-12470
                 URL: https://issues.apache.org/jira/browse/GROOVY-12470
             Project: Groovy
          Issue Type: Bug
    Affects Versions: 6.0.0, 5.1.3, 4.0.33, 5.0.3, 3.0.25, 2.5.23
            Reporter: Björn Kautler


Given the following snippet:
{code:groovy}
@groovy.transform.CompileStatic
class Foo {
  def foo() {
    super.toString()
  }
  @Override
  String toString() {
    "FOO: ${super.toString()}"
  }
}
new Foo().foo()
new Foo().toString()
{code}
Both calls in the end work fine without static compilation, but cause a 
{{StackOverflowError}} because {{toString}} calls itself instead of the 
super-method.

Expected is like without static compilaton once the super {{toString}} and for 
the second call the {{FOO}} prefix.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to