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

Closures nested more than two deep can't access top level variables

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-beta-3
    • 1.0-beta-4
    • None
    • None

    Description

      class Test {
      static main(args) {
      a =

      { it()}
      b = { it()}

      c =

      { it()}

      a() {
      b() {
      c() {
      }
      }
      }
      }
      }

      throws groovy.lang.GroovyRuntimeException: c

      it appears it can't find c when nested two deep

      Attachments

        Activity

          People

            Unassigned Unassigned
            tug John Wilson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: