Details
-
Bug
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
3.0.3, 4.0.21
-
None
-
None
Description
Probably affects all Groovy 3 and 4 (possibly 5, haven't tried), but not Groovy 2. Perhaps the Parrot parser? Groovy 3.0.3 is the oldest I've tested; alas the Affects Versions does not allow entering something like “3+”, which would make more sense I think.
Some errors in closures are reported as an unexpected input (which is all right) at the opening { of the closure (that's not OK). E.g.,
1035 ocs /tmp> /usr/local/groovy-4.0.21/bin/groovy q org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /private/tmp/q.groovy: 1: Unexpected input: '{' @ line 1, column 10. 10.times { bar()) } ^
Happens with longer multi-line closures as well, which might lead to a really inconvenient search for the real culprit.
Note that normal non-closure blocks are not affected:
1036 ocs /tmp> /usr/local/groovy-4.0.21/bin/groovy w org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: /private/tmp/w.groovy: 1: Unexpected input: '{ foo())' @ line 1, column 31. for (int n=0;n<10;n++) { foo()) } ^