You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniil Ovchinnikov (Jira)" <ji...@apache.org> on 2020/09/09 16:33:00 UTC

[jira] [Created] (GROOVY-9734) Generic is not inferred from context

Daniil Ovchinnikov created GROOVY-9734:
------------------------------------------

             Summary: Generic is not inferred from context
                 Key: GROOVY-9734
                 URL: https://issues.apache.org/jira/browse/GROOVY-9734
             Project: Groovy
          Issue Type: Bug
          Components: Static Type Checker
    Affects Versions: 2.5.13, 3.0.5
            Reporter: Daniil Ovchinnikov


{code:title=bugs.groovy}
static void stuff(List<String> operations) {}

@groovy.transform.CompileStatic
void usage() {
    stuff(Collections.emptyList()) // 
}

usage()
{code}

Results in compilation error:
{noformat}
[Static type checking] - Cannot call bugs#stuff(java.util.List <java.lang.String>) with arguments [java.util.List <T extends java.lang.Object>] 
 @ line 5, column 5.
       stuff(Collections.emptyList())
       ^
{noformat}



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