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 15:52:00 UTC

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

Eric Milles created GROOVY-10036:
------------------------------------

             Summary: 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
            Reporter: Eric Milles
            Assignee: Eric Milles


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)