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/03/28 19:04:00 UTC
[jira] [Assigned] (GROOVY-8909) List literal type inference does
not take its context into account
[ https://issues.apache.org/jira/browse/GROOVY-8909?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-8909:
-----------------------------------
Assignee: Eric Milles
> List literal type inference does not take its context into account
> ------------------------------------------------------------------
>
> Key: GROOVY-8909
> URL: https://issues.apache.org/jira/browse/GROOVY-8909
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.5.4
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
>
> {code:title=bug.groovy}
> def methodAcceptingListOfObjects(List<Object> lo) {}
> @groovy.transform.CompileStatic
> def usage() {
> methodAcceptingListOfObjects([1, 2, 3])
> }
> {code}
> Compilation fails with
> {noformat}
> [Static type checking] - Cannot call #methodAcceptingListOfObjects(java.util.List <java.lang.Object>) with arguments [java.util.List <java.lang.Integer>]
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)