You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Chih Chao Yu (JIRA)" <ji...@apache.org> on 2019/08/15 07:06:00 UTC
[jira] [Created] (GROOVY-9226) Call super.toString() with
@TypeChecked or @CompileStatic will throw java.lang.StackOverflowError
Chih Chao Yu created GROOVY-9226:
------------------------------------
Summary: Call 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
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)