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

FP Cycle detected in type parameter that extends another type parameter

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

      Description

      I have the following Groovy program.

      @groovy.transform.TypeChecked
      class Test<X, Y extends X> {}
      

      Actual Behavior

      The program does not compile, and I get the following error.

      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      Test.groovy: 2: Cycle detected: the type java.lang.Object cannot extend/implement itself or one of its own member types
       @ line 2, column 25.
         class Test<X, Y extends X> {}
                                 ^
      
      1 error
      

      Expected Behavior

      Compile successfully.

      Comment

      This bug is a regression because it compiles successfully with 3.0.8 and 4.0.0-alpha-3. Specifically, the fix of GROOVY-10113 introduced this bug.

      Affected Version

      This programs have been tested with the compiler from the master (commit: 05a39632565bee88949c8db9d56b9f9598321fc2).

        Attachments

          Activity

            People

            • Assignee:
              emilles Eric Milles
              Reporter:
              schaliasos Stefanos Chaliasos

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment