Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0-alpha-2, 3.0.8
Description
I have the following Groovy program.
@groovy.transform.TypeChecked class Test<T extends T> {}
Actual Behavior
The compiler crashes with the following stacktrace.
>>> a serious error occurred: null
>>> stacktrace:
java.lang.StackOverflowError
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
....
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
at org.codehaus.groovy.ast.ClassNode.redirect(ClassNode.java:195)
Expected Behavior
Compile-time error. I would expect to report a cyclic inheritance error.
Affected Version
This programs have been tested with the compiler from the master (commit: c36c8bf3d24ce41e972e3f3e7a5763acf96f46b1), 4.0.0-alpha-2, and 3.0.8.