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

static compiler fails with bug massage for method call in loop increment

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.0.2
    • Static compilation
    • None

    Description

      This code

      @CompileStatic
      class X {
          static void bar(){
              for (int i=0;i<1000000; i+=foo()){}
          }
          static foo(){1}
      }

      may not make so much sense, but should at least not fail during compilation with a GroovyBugError. The message complains about the method call in the i+=foo() part

      Attachments

        Activity

          People

            melix Cédric Champeau
            blackdrag Jochen Theodorou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: