[
https://issues.apache.org/jira/browse/GROOVY-9606?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Paul King reassigned GROOVY-9606:
---------------------------------
Assignee: (was: Daniel Sun)
> Traits using generics generate incorrect stub for Methods
> ---------------------------------------------------------
>
> Key: GROOVY-9606
> URL: https://issues.apache.org/jira/browse/GROOVY-9606
> Project: Groovy
> Issue Type: Bug
> Components: Stub generator / Joint compiler
> Affects Versions: 2.5.6
> Reporter: Keegan Witt
> Priority: Major
>
> {code:groovy}
> trait SomeGroovyTrait<D> {
> List<D> list(D arg) {
> [arg]
> }
> }
> class SomeGroovyClass implements SomeGroovyTrait<String> { }
> {code}
> Generates a stub like this
> {code:groovy}
> ...
> public class SomeGroovyClass implements SomeGroovyTrait<java.lang.String>,
> groovy.lang.GroovyObject {
> ...
> public java.util.List<D> list(D arg) { return (java.util.List<D>)null;}
> // <== D should be String
> }
> {code}
> Note that the return type and parameter types use {{D}} instead of type
> {{String}} and the generic reference isn't declared in the class either.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)