Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-5500

GroovyBugError thrown when it shouldn't be

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-3
    • 2.0-rc-3, 1.8.7
    • None
    • None

    Description

      The following code throws a GroovyBugError:

      print "Foo" ===~ ".*"
      

      but this seems wrong to me. A GroovyBugError, as I understand it, is supposed to be only thrown for internal compiler errors, meaning that there is a bug in the compiler. This seems to me to be a candidate for a SyntaxError.

      It seems that there is a simple fix. In the default block of org.codehaus.groovy.classgen.asm.BinaryExpressionHelper.eval(BinaryExpression), change throws new GroovyBugError(..) to throws new SyntaxException(..).

      I only tried this on Groovy 2.0.0 beta 3 and Groovy 1.8.6.

      Attachments

        Activity

          People

            paulk Paul King
            werdna Andrew Eisenberg
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: