[
https://issues.apache.org/jira/browse/GROOVY-8133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15945387#comment-15945387
]
Iurii commented on GROOVY-8133:
-------------------------------
[~daniel_sun] Can it be implemented as a feature?
With Java 8 adoption we have more and more methods that return Stream.
It would be very useful to support spread operator for streams.
Are there any restrictions why it cannot be done?
> 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)