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

for variable omitted type makes Caught: BUG! exception in phase 'class generation'

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2
    • Component/s: class generator, Compiler
    • Labels:
      None
    • Environment:
      Mac OS X
       java version "1.6.0_33"
      Java(TM) SE Runtime Environment (build 1.6.0_33-b03-424-11M3720)
      Java HotSpot(TM) 64-Bit Server VM (build 20.8-b03-424, mixed mode)

      Description

      Following code:

      @groovy.transform.CompileStatic
      def foo() {
          int[] perm = new int[10]
          for (i in 0..<10) {
            println(perm[i-0])
          }
      }
      
      

      generates error message:

      Caught: BUG! exception in phase 'class generation' in source unit '/private/tmp/f.groovy' At line 13 column 20
      On receiver: i with message: minus and arguments: 0
      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
      BUG! exception in phase 'class generation' in source unit '/private/tmp/f.groovy' At line 13 column 20
      On receiver: i with message: minus and arguments: 0
      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

      following is ok

      @groovy.transform.CompileStatic
      def foo() {
          int[] perm = new int[10]
          for (int i in 0..<10) {
            println(perm[i-0])
          }
      }
      
      

        Attachments

          Activity

            People

            • Assignee:
              melix C├ędric Champeau
              Reporter:
              uehaj UEHARA Junji
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: