You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2020/11/11 02:02:05 UTC

[jira] [Closed] (GROOVY-8961) Cannot pass generic list into explicit setter

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

Paul King closed GROOVY-8961.
-----------------------------

> Cannot pass generic list into explicit setter
> ---------------------------------------------
>
>                 Key: GROOVY-8961
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8961
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.5.5
>            Reporter: Daniil Ovchinnikov
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 4.0.0-alpha-1, 3.0.6
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> {code}
> class GC {
>     void setStrings(List<String> ss) {}
> }
> @groovy.transform.CompileStatic
> void usage(GC gc) {
>     gc.strings = Collections.emptyList()
> }
> {code}
> {noformat}
> [Static type checking] - Cannot assign value of type java.util.List <T extends java.lang.Object> to variable of type java.util.List <String>
>  at line: 7, column: 5
> {noformat}



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