[
https://issues.apache.org/jira/browse/GROOVY-9915?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles updated GROOVY-9915:
--------------------------------
Fix Version/s: 3.0.9
> STC: call to static method fails with incompatible generics error
> -----------------------------------------------------------------
>
> Key: GROOVY-9915
> URL: https://issues.apache.org/jira/browse/GROOVY-9915
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.5.14, 3.0.7, 4.0.0-alpha-2
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-3, 3.0.9
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> Consider the following:
> {code:groovy}
> @groovy.transform.CompileStatic
> class C {
> void m() {
> init(Collections.emptyList())
> }
> private static void init(List<String> strings) {
> print strings
> }
> }
> new C().m()
> {code}
> Call to "init" is fails to match {{Collections.emptyList()}} to
> {{List<String>}}. If "init" is non-static, it works fine. Error displayed
> is:
> {code}
> Static type checking] - Cannot call C#init(java.util.List <java.lang.String>)
> with arguments [java.util.List <T extends java.lang.Object>]
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)