groovy

Incorrect behaviour of a parse error.

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Ubuntu 6.06 LTS "Dapper Drake" + JDK 1.5.0_06 + Groovy r4101
  • Number of attachments :
    0

Description

The script:

final groovyHome = System.getenv ( 'GROOVY_HOME' ) ; { assert groovyHome != '' }

gives a reasonable error message. However, the script:

( new GroovyShell ( ) ).evaluate ("final groovyHome = System.getenv ( 'GROOVY_HOME' ) ; { assert groovyHome != '' }")

gives the almost incomprehensible:

Caught: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed,
at parseError.run(parseError.groovy:1)
at parseError.main(parseError.groovy)

Activity

Hide
Russel Winder added a comment -

A similar error message is now generated in both cases so in that respect things are fixed. However, is the error message:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, ./GROOVY_1527.groovy: 3: Closure expression looks like it may be an isolated open block.;
solution: Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}. @ line 3, column 54.
em.getenv ( 'GROOVY_HOME' ) ; { assert g
^

for the first script actually reasonable?

Show
Russel Winder added a comment - A similar error message is now generated in both cases so in that respect things are fixed. However, is the error message: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed, ./GROOVY_1527.groovy: 3: Closure expression looks like it may be an isolated open block.; solution: Add an explicit parameter list, as in {it -> ...}, or label it as L:{...}. @ line 3, column 54. em.getenv ( 'GROOVY_HOME' ) ; { assert g ^ for the first script actually reasonable?
Hide
Andres Almiray added a comment -

Both scripts now yield the same error message, can this be closed then?

Show
Andres Almiray added a comment - Both scripts now yield the same error message, can this be closed then?
Hide
Paul King added a comment -

Closing - there is already an open issue related to improving such an error message: GROOVY-1742

Show
Paul King added a comment - Closing - there is already an open issue related to improving such an error message: GROOVY-1742

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: