Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-10113

StackOverflowError in STC

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.0.0-alpha-2, 3.0.8
    • Fix Version/s: 4.0.0-beta-1, 3.0.9
    • Component/s: Static Type Checker
    • Labels:
      None

      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.

        Attachments

          Activity

            People

            • Assignee:
              emilles Eric Milles
              Reporter:
              schaliasos Stefanos Chaliasos
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h