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 2015/05/18 12:50:59 UTC

[jira] [Commented] (GROOVY-7377) Interpolated variable followed by asterisk in slashy-string causes compiler error

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

Paul King commented on GROOVY-7377:
-----------------------------------

Another interesting snippet from here:
http://marc.info/?l=groovy-scm&m=118311049022736

Relevant piece:
{noformat}
o Spread argument directly in GStrings removed
        def bar = [1,2,3]
        def g = "foo$*bar"
{noformat}
So indeed, '$*' was supported pre June 2007

> Interpolated variable followed by asterisk in slashy-string causes compiler error
> ---------------------------------------------------------------------------------
>
>                 Key: GROOVY-7377
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7377
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 2.4.3
>         Environment: Windows 7 via gvm
> Java 1.8_40
>            Reporter: Martin Neal
>            Priority: Minor
>
> {code}
> @Test
> void slashyStringWithInterpolatedVariableFollowedByAsterisk() {
>         // currently throws org.codehaus.groovy.control.MultipleCompilationErrorsException
>     assert Eval.me('''def foo='bar'; /$foo*baz/''') == 'bar*baz'
>     assert Eval.me('''def foo='bar'; /${foo}*baz/''') == 'bar*baz'
>     assert Eval.me('''def foo='bar'; /$foo\u002abaz/''') == 'bar*baz'
>     assert Eval.me('''def foo='bar'; /${foo}\u002abaz/''') == 'bar*baz'
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)