groovy
  1. groovy
  2. GROOVY-5318

generic types in fully-qualified class names parsing error

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.8.6
    • Fix Version/s: 4.0
    • Component/s: parser
    • Labels:
      None
    • Environment:
      Groovy 1.8.6 on Java 7
    • Number of attachments :
      0

      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)*
      

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Gavin Grover
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: