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

Stub generator handles method type parameter bounds incorrectly

    XMLWordPrintableJSON

Details

    Description

      A declaration of: 

      def <R extends SyntaxNode, O extends Node> List<O> $$(Collection<? extends R> input, Class<O> outputType = Node) 

      yields (package FQ names omitted for brevity): 

      public <R extends SyntaxNode, O extends Node> java.util.List<O> $$(java.util.Collection<? extends SyntaxNode<R extends SyntaxNode>> input, java.lang.Class<O> outputType) { return (List<O>)null;} 

      which of course doesn't compile, because extends SyntaxNode does not belong to the type declaration of the method parameter. 

       

      The issue seems to only affect constrained wildcards, note that the other method parameter turns out just fine. 

      Attachments

        Activity

          People

            emilles Eric Milles
            crizzis Krzysztof Sierszeń
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: