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

generic types in fully-qualified class names parsing error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.8.6
    • 2.5.0-alpha-1
    • parser
    • None
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: