[
https://issues.apache.org/jira/browse/GROOVY-9674?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18149167#comment-18149167
]
Daniel Sun commented on GROOVY-9674:
------------------------------------
Fixed on master; added a regression test in
3c6fa0f1eda74a3cea72296b2c004da9ee63dc61
(https://github.com/apache/groovy/commit/3c6fa0f1eda74a3cea72296b2c004da9ee63dc61).
> Compilation error, when compiling code with excess parantheses
> --------------------------------------------------------------
>
> Key: GROOVY-9674
> URL: https://issues.apache.org/jira/browse/GROOVY-9674
> Project: Groovy
> Issue Type: Bug
> Components: Compiler
> Affects Versions: 3.0.5
> Environment: Openjdk version "11.0.8" 2020-07-14
> OpenJDK Runtime Environment (build 11.0.8+10-post-Ubuntu-0ubuntu120.04)
> OpenJDK 64-Bit Server VM (build 11.0.8+10-post-Ubuntu-0ubuntu120.04, mixed
> mode, sharing)
> Reporter: Olaf Krische
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 7.0.0-alpha-1
>
>
> I have two formulas, and both are equivalent (to me at least).
> String formula1 = "var_00000 - (var_group_combined_or - var_00000)";
> String formula2 = "var_00000 - ((var_group_combined_or) - var_00000)";
> With Groovy 2.5 it compiles, starting with Groovy3 i get compile exception,
> when doing this in Java:
> {code:java}
> GroovyShell SHELL = new GroovyShell();
> Script parse1 = SHELL.parse(String.format("closure={%s}", formula1));
> Script parse2 = SHELL.parse(String.format("closure={%s}", formula2));
> org.codehaus.groovy.control.MultipleCompilationErrorsException: startup
> failed:
> Script2.groovy: 1: unable to resolve class var_group_combined_or
> @ line 1, column 22.
> closure={var_00000 - ((var_group_combined_or) - var_00000)}
> {code}
> Is this a bug on my side or is there some misunderstanding with the spec on
> my side?
> Thank you!
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)