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 2026/10/23 02:34:00 UTC
[jira] [Resolved] (GROOVY-12470) SC: super-method calls do not work under static compilation
[ https://issues.apache.org/jira/browse/GROOVY-12470?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King resolved GROOVY-12470.
--------------------------------
Resolution: Fixed
> 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: 2.5.23, 3.0.25, 5.0.3, 4.0.33, 5.1.3, 6.0.0
> Reporter: Björn Kautler
> Assignee: Paul King
> Priority: Major
> Fix For: 4.0.34, 7.0.0-alpha-1, 5.1.4, 6.0.1
>
>
> 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
(v10.3.26#10030026)