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

Can't access private field from closure

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.0-JSR-2
    • 1.0-RC-1
    • None
    • None
    • WinXP, jdk1.5

    Description

      I get an illegal access error when accessing a private field from a closure,
      see example:

      class ClosurePrivateField {
      def doIt() {

      { it -> println hallo }

      ()
      }

      private String hallo = "hallo"

      public static void main(String[] args)

      { new ClosurePrivateField().doIt() }

      }

      Attachments

        Issue Links

          Activity

            People

              blackdrag Jochen Theodorou
              tof Christof Vollrath
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: