Olaf Krische created GROOVY-9674:
------------------------------------
Summary: 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
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
(v8.3.4#803005)