You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Krzysztof Sierszeń (Jira)" <ji...@apache.org> on 2022/04/16 12:49:00 UTC

[jira] [Updated] (GROOVY-10583) Stub generator handles method type parameter bounds incorrectly

     [ https://issues.apache.org/jira/browse/GROOVY-10583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Krzysztof Sierszeń updated GROOVY-10583:
----------------------------------------
    Description: 
A declaration of: 
{code:java}
def <R extends SyntaxNode, O extends Node> List<O> $$(Collection<? extends R> input, Class<O> outputType = Node) {code}
yields (package FQ names omitted for brevity): 
{code:java}
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;} {code}
which of course doesn't compile, because {{extends SyntaxNode}} does not belong to the type declaration of the method parameter. 

  was:
A declaration of: 
{code:java}
def <R extends SyntaxNode, O extends Node> List<O> $$(Collection<? extends R> input, Class<O> outputType = Node) {code}
yields (package FQ names omitted for brevity): 
{code:java}
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;} {code}
which of course doesn't compile, because `extends SyntaxNode` does not belong to the type declaration of the method parameter. 


> Stub generator handles method type parameter bounds incorrectly
> ---------------------------------------------------------------
>
>                 Key: GROOVY-10583
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10583
>             Project: Groovy
>          Issue Type: Bug
>            Reporter: Krzysztof Sierszeń
>            Priority: Major
>
> A declaration of: 
> {code:java}
> def <R extends SyntaxNode, O extends Node> List<O> $$(Collection<? extends R> input, Class<O> outputType = Node) {code}
> yields (package FQ names omitted for brevity): 
> {code:java}
> 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;} {code}
> which of course doesn't compile, because {{extends SyntaxNode}} does not belong to the type declaration of the method parameter. 



--
This message was sent by Atlassian Jira
(v8.20.1#820001)