You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/05/02 02:04:18 UTC
[jira] [Closed] (GROOVY-6212) SpreadExpression BUG! when slicing a
List
[ https://issues.apache.org/jira/browse/GROOVY-6212?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King closed GROOVY-6212.
-----------------------------
> SpreadExpression BUG! when slicing a List
> -----------------------------------------
>
> Key: GROOVY-6212
> URL: https://issues.apache.org/jira/browse/GROOVY-6212
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 2.1.5, 2.4.0-rc-1
> Reporter: Alexey Rusakovich
> Assignee: Paul King
> Fix For: 2.5.0-alpha-1
>
>
> Evaluating
> {code}
> (1..3)[*0..2]
> {code}
> throws: {{BUG! exception in phase 'class generation' in source unit 'ConsoleScript42' SpreadExpression should not be visited here}}
> It works fine if I manually call {{getAt}}:
> {code}
> (1..3).getAt([*0..2]) // [1, 2, 3]
> {code}
> It also works if I add something besides the spread:
> {code}
> (1..3)[*0..2, 2] // [1, 2, 3, 3]
> {code}
> as shown in the Ranges and List-Slicing section of [Getting Started Guide > Collections|http://groovy.codehaus.org/JN1015-Collections].
> There are other SpreadExpression BUG!s, but I'm not sure if this bug is the same:
> http://jira.codehaus.org/issues/?jql=text%20%7E%20%22SpreadExpression%22
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)