You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Daniel Sun (JIRA)" <ji...@apache.org> on 2017/03/28 15:07:41 UTC

[jira] [Commented] (GROOVY-8133) Static type checking failure for streams and spread operator

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

Daniel Sun commented on GROOVY-8133:
------------------------------------

As the compiler prompts: {code}[Static type checking] - Spread operator can only be used on collection types{code}, Stream is not a collection type. So this is not an issue IMHO.

> Static type checking failure for streams and spread operator
> ------------------------------------------------------------
>
>                 Key: GROOVY-8133
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8133
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 2.4.10
>         Environment: Windows 7, JDK 1.8.0_66
>            Reporter: Iurii
>
> Input files:
> Test.groovy
> class Test {
>     static void main(String[] args) {
>         [1, 2, 3].stream()*.toString()
>     }
> }
> compiler-config.groovy
> import groovy.transform.CompileStatic
> withConfig(configuration) {
>     ast(CompileStatic)
> }
> Error:(3, 9) Groovyc: [Static type checking] - Spread operator can only be used on collection types
> Expected: static type checking allows spread operator for streams



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)