groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-8133) Static type checking failure for streams and spread operator
Date Wed, 29 Mar 2017 03:55:41 GMT

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

Paul King commented on GROOVY-8133:
-----------------------------------

I changed to a feature request not a bug. It would certainly be nice to support the spread
operator on streams. I think the expectation would be that a stream was returned. I think
it makes most sense to add that for when we require JDK8. Once we add such a capability we'd
then need to potentially tweak the static compiler to know about it.

> 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: Improvement
>          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)

Mime
View raw message