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

leftShift in simple closure won't CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Duplicate
    • 2.4.5, 2.4.6
    • 2.4.8
    • Static compilation
    • None

    Description

      @groovy.transform.CompileStatic
      def bug()
      {
          [1,2,3].collect{it<<2}
      }
      

      The code above works correctly with CompileDynamic, but CompileStatic will produce the following error:

      BUG! exception in phase 'class generation' in source unit 'ConsoleScript1' At line 4 column 21
      On receiver: it with message: leftShift and arguments: 2
      This method should not have been called. Please try ...
      

      The same with >> or >>>.

      Attachments

        Issue Links

          Activity

            People

              paulk Paul King
              biafab Fabiano Biagini
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: