[
https://issues.apache.org/jira/browse/GROOVY-7765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15169914#comment-15169914
]
Paul King commented on GROOVY-7765:
-----------------------------------
This is a limitation within the current grammmar for both the slashy and dollar
slashy strings. It isn't really to do with 'assert' per se. These also won't
work:
{code}
assert /aaa/ == 'aaa'
println /aaa/
println $/aaa/$
{code}
brackets are your friends here:
{code}
assert ($/aaa/$ == 'aaa')
println ($/aaa/$)
{code}
We aren't likely to fix this in the current grammar. It is a good thing to look
at when doing our antlr4 grammar (currently being spiked).
> Dollar Slashy String in assert not working left hand side
> ----------------------------------------------------------
>
> Key: GROOVY-7765
> URL: https://issues.apache.org/jira/browse/GROOVY-7765
> Project: Groovy
> Issue Type: Bug
> Affects Versions: 2.4.5
> Reporter: dariusan
>
> {code}
> assert 'aaa'==$/aaa/$ //works
> assert $/aaa/$=='aaa' //fails with Invalid variable name. Must include a
> letter but only found: $
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)