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

generic type definition with reference to other type parameter fails to compile

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.6, 2.4.5, 2.4.15
    • 2.5.2
    • Compiler
    • None

    Description

      This compiles with javac but not with groovyc:

      A.java
      class A<TypeA extends A<TypeA, TypeB>,
              TypeB extends B<TypeB, TypeA>> {
      }
      
      B.java
      class B<TypeB extends B<TypeB, TypeA>,
              TypeA extends A<TypeA, TypeB>> {
      }
      org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
      A.java: 1: unable to resolve class TypeB 
       @ line 1, column 32.
         class A<TypeA extends A<TypeA, TypeB>,
                                        ^
      
      B.java: 1: unable to resolve class TypeA 
       @ line 1, column 32.
         class B<TypeB extends B<TypeB, TypeA>,
                                        ^
      
      2 errors
      

      Attachments

        Activity

          People

            paulk Paul King
            kgeis Ken Geis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: