groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Sun (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (GROOVY-9226) Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
Date Thu, 15 Aug 2019 07:22:00 GMT

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

Daniel Sun resolved GROOVY-9226.
--------------------------------
    Resolution: Fixed

Fixed by [https://github.com/apache/groovy/commit/5865a07f4537717c6f7d2600ae1fbf30a2e5db87]

Here is the test:

[https://github.com/apache/groovy/commit/007877d9b5414ddd08ac34444a30c9712bf5754c]

> Calling super.toString() with @TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
> ----------------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-9226
>                 URL: https://issues.apache.org/jira/browse/GROOVY-9226
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.x, 2.5.x
>         Environment: Any operating systems running Groovy 2.4.x or 2.5.x
>            Reporter: Chih Chao Yu
>            Assignee: Daniel Sun
>            Priority: Major
>             Fix For: 3.0.0-beta-4
>
>
> The following code snippet will throw java.lang.StackOverflowError:
> {code:java}
> import groovy.transform.CompileStatic
> import groovy.transform.TypeChecked
> @CompileStatic
> class Super {
>   String toString() { 'Super' }
> }
> @TypeChecked
> @CompileStatic
> class Child extends Super {
>   String toString() { 'Child extends ' + super.toString() }
> }
> // java.lang.StackOverflowError will happen
> println new Child().toString(){code}
>  



--
This message was sent by Atlassian JIRA
(v7.6.14#76016)

Mime
View raw message