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

Nested type parameters are ignored in some situations

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 1.7.3
    • Fix Version/s: 1.7.6
    • Component/s: parser
    • Labels:
      None

      Description

      Given this simple groovy snippet:

      class Structure<U> { }
      new Structure<java.util.List<Integer>>()
      

      and looking at the AST browser, you can see that in the constructor call for Structure does not have the proper generics types. The nested <Integer> is dropped, even though the outer <java.util.List> exists.

      I believe that the problem comes from AntlrPluginParser.makeType(AST), which converts an Antlr AST node into a ClassNode, but does not recur down any existing type parameters.

      I am using Groovy 1.7.3, so this may be fixed in 1.7.5, but I have not seen any issue for this raised in jira, so I am guessing it is not.

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              werdna Andrew Eisenberg
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: