You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2015/06/01 02:46:17 UTC
[jira] [Commented] (GROOVY-6212) SpreadExpression BUG! when slicing
a List
[ https://issues.apache.org/jira/browse/GROOVY-6212?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14566853#comment-14566853 ]
ASF GitHub Bot commented on GROOVY-6212:
----------------------------------------
GitHub user paulk-asert opened a pull request:
https://github.com/apache/incubator-groovy/pull/30
GROOVY-6212: SpreadExpression BUG! when slicing a List
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/paulk-asert/incubator-groovy groovy6212
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-groovy/pull/30.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #30
----
commit 1e34509199f3b23c1ee6de7f4a6b6e1b8407cfaf
Author: Paul King <pa...@asert.com.au>
Date: 2015-06-01T00:43:49Z
GROOVY-6212: SpreadExpression BUG! when slicing a List
----
> 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
>
> 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.4#6332)