groovy
  1. groovy
  2. GROOVY-3297

VerifyError on when a syntax error would be more appropriate

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5.7
    • Fix Version/s: 1.5.8
    • Component/s: None
    • Labels:
      None
    • Environment:
      Groovy Version: 1.5.7 JVM: 1.6.0_11
      win xp sp 2
    • Number of attachments :
      0

      Description

      C:\>groovy -e "(i++)++"
      Caught: java.lang.VerifyError: (class: script_from_command_line, method: run signature: ()Ljava/lang/Object;) 
      Unable to pop operand off an empty stack
      

      In Java this is not a valid expression, but w/ overloadable operators in Groovy I guess it should be? In any case, VerifyError is not the appropriate thing to do - if this expression is not valid, some sort of syntax error might be better and more informative?

        Activity

        Hide
        blackdrag blackdrag added a comment -

        added some code tags

        Show
        blackdrag blackdrag added a comment - added some code tags
        Hide
        blackdrag blackdrag added a comment -

        say, did you test this with the current 1.5.8? Because this kind of issue should be fixed in 1.6rc1 already and IMHO the fix was backported

        Show
        blackdrag blackdrag added a comment - say, did you test this with the current 1.5.8? Because this kind of issue should be fixed in 1.6rc1 already and IMHO the fix was backported
        Hide
        Antti Karanta added a comment -

        You're right - this is fixed in 1.6.0 RC 1:

        C:\programs\Java>Groovy-1.6.0-RC-1\bin\groovy.exe -e "(i+)+"
        Caught: groovy.lang.MissingPropertyException: No such property: i for class: script_from_command_line
        at script_from_command_line.run(script_from_command_line:1)

        Sorry for the noise.

        Show
        Antti Karanta added a comment - You're right - this is fixed in 1.6.0 RC 1: C:\programs\Java>Groovy-1.6.0-RC-1\bin\groovy.exe -e "(i+ ) +" Caught: groovy.lang.MissingPropertyException: No such property: i for class: script_from_command_line at script_from_command_line.run(script_from_command_line:1) Sorry for the noise.

          People

          • Assignee:
            Unassigned
            Reporter:
            Antti Karanta
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: