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

generic types in fully-qualified class names parsing error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.8.6
    • Fix Version/s: 2.5.0-alpha-1
    • Component/s: parser
    • Labels:
      None
    • Environment:
      Groovy 1.8.6 on Java 7

      Description

      The following code compiles and runs in Groovy 1.8.6...

      def a= new java.util<Integer>.ArrayList<ArrayList<Integer>>()
      

      The parser allows a generic type after each name in the fully-qualified class name. The generic type should only be after the final name.

      The relevant part of the Antlr parser that needs fixing is:

      typeParameters: LT typeParameter (COMMA typeParameter)* (typeArgumentsOrParametersEnd)?
      typeParameter: IDENT (typeParameterBounds)?
      typeParameterBounds: "extends" classOrInterfaceType (BAND! classOrInterfaceType)*
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                daniel_sun Daniel Sun
                Reporter:
                gavingrover Gavin Grover
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: