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

Static type compiler failure when defining a closure using the / operator

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0-beta-3
    • 2.0-rc-3
    • Static Type Checker
    • None

    Description

      The following class definition results in the error:

      @CompileStatic
      class StaticGroovy2 {
          def foo(Closure cls) {}
          def bar() {	foo{ it / 2 } }
      }
      

      >>> a serious error occurred: BUG! exception in phase 'class generation' in source unit '../src/StaticGroovy2.groovy' At line 10 column 8
      On receiver: it with message: div and arguments: 2
      This method should not have been called. Please try to create a simple example reproducing this error and filea bug report at http://jira.codehaus.org/browse/GROOVY

      It seem to fail only with the /, because it works with other operators like: + - *

      Attachments

        Activity

          People

            melix Cédric Champeau
            rgarcia Renato Garcia
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: