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

not finding local variable in method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.0-JSR-2
    • class generator
    • None
    • mac osX 1.4.2 CVS HEAD as of Aug 24, 2004

    Description

      The following code fails:

      class bugp {
      doit()

      { x = 1 if(x == 1) p = 'hi' else p = 'goodbye' println p }

      static void main(String[] args)

      { new bugp().doit() }

      }

      Looking at the decompiled JVM code, the p is declared as a local variable within the method, but the reference to p in the println statement is calling getProperty("p"), which of course it won't find. This used to work, so my guess is the new compiler optimizations that Bing put in is the cause.... If not, sorry Bing, please reassign.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            johnstump John Stump
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: