You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2021/04/14 20:45:00 UTC

[jira] [Updated] (GROOVY-10036) STC: unresolved generics for return type of extension method call with full type arguments

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

Eric Milles updated GROOVY-10036:
---------------------------------
    Affects Version/s: 2.5.14
                       3.0.7
                       4.0.0-alpha-3

> STC: unresolved generics for return type of extension method call with full type arguments
> ------------------------------------------------------------------------------------------
>
>                 Key: GROOVY-10036
>                 URL: https://issues.apache.org/jira/browse/GROOVY-10036
>             Project: Groovy
>          Issue Type: Improvement
>          Components: Static Type Checker
>    Affects Versions: 2.5.14, 3.0.7, 4.0.0-alpha-3
>            Reporter: Eric Milles
>            Assignee: Eric Milles
>            Priority: Minor
>
> Consider the following:
> {code:groovy}
> @groovy.transform.TypeChecked
> void test() {
>   def list = ['x','y']
>   def map = list.<String,Object,String>collectEntries { [it, it.length()] }
> }
> {code}
> The type checker infers {{Map<K,V>}} for the type of "map" even though all type arguments are provided to "collectEntries".
> {code:java}
>     public static <K,V,E> Map<K, V> collectEntries(Iterable<E> self, @ClosureParams(FirstParam.FirstGenericType.class) Closure<?> transform)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)