[ 
https://issues.apache.org/jira/browse/GROOVY-8983?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17499187#comment-17499187
 ] 

Eric Milles commented on GROOVY-8983:
-------------------------------------

https://github.com/apache/groovy/commit/cdc89b4052e0bca0af107da4601560b6fa23315c
https://github.com/apache/groovy/commit/f8403f2610cdcee912a2c717798262748eacaaee

> 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.20.1#820001)

Reply via email to