[
https://issues.apache.org/jira/browse/GROOVY-10724?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149190#comment-18149190
]
Daniel Sun commented on GROOVY-10724:
-------------------------------------
Fixed on master; added a regression test in
5ac4d6dacc75123ccd0603d43ff27cd335ffc7f4
(https://github.com/apache/groovy/commit/5ac4d6dacc75123ccd0603d43ff27cd335ffc7f4).
> Parrot parser incorrectly treats an expression wrapped in parentheses as a
> cast
> -------------------------------------------------------------------------------
>
> Key: GROOVY-10724
> URL: https://issues.apache.org/jira/browse/GROOVY-10724
> Project: Groovy
> Issue Type: Bug
> Components: parser-antlr4
> Affects Versions: 3.0.12
> Reporter: Marcin Erdmann
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 7.0.0-alpha-1
>
>
> Trying to compile this code:
> {code:java}
> def a = ""
> (a) in []
> {code}
> results in
> {code:java}
> /path/to/file/Foo.groovy: 10: unable to resolve class a
> @ line 21, column 9.
> (a) in []
> ^
> 1 error
> {code}
> Obviously the parentheses are not necessary and the problem goes away if you
> drop them but it would be good if that code was still allowed like it was in
> 2.5 or if at least the error wasn't so confusing.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)