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 2020/09/14 17:00:00 UTC

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

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

Eric Milles resolved GROOVY-9734.
---------------------------------
    Resolution: Duplicate

Duplicate of GROOVY-8961

> 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: 3.0.5, 2.5.13
>            Reporter: Daniil Ovchinnikov
>            Priority: Major
>
> {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)