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/04/07 13:29:00 UTC
[jira] [Resolved] (GROOVY-8983) Cannot assign Collection to Array
[ https://issues.apache.org/jira/browse/GROOVY-8983?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles resolved GROOVY-8983.
---------------------------------
Fix Version/s: 4.0.0-alpha-3
Resolution: Fixed
> Cannot assign Collection to Array
> ---------------------------------
>
> Key: GROOVY-8983
> URL: https://issues.apache.org/jira/browse/GROOVY-8983
> Project: Groovy
> Issue Type: Bug
> Components: Static Type Checker
> Affects Versions: 2.5.6
> Reporter: Daniil Ovchinnikov
> Assignee: Eric Milles
> Priority: Major
> Fix For: 4.0.0-alpha-3
>
> Time Spent: 0.5h
> Remaining Estimate: 0h
>
> {code:java}
> Collection<? extends Runnable> foo() {}
> @groovy.transform.CompileStatic
> def usage() {
> Runnable[] ar = foo() // OK as expected
> }
> @groovy.transform.CompileStatic
> def usage(Collection<? extends Runnable> cr) {
> Runnable[] ar = cr // [Static type checking] - Cannot assign value of type java.util.Collection <? extends java.lang.Runnable> to variable of type java.lang.Runnable[]
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)