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

NullPointerException compiling fully qualified reference to 'this' of outer class inside inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.4, 2.3.6
    • 2.3.11, 2.4.0
    • Compiler
    • None

    Description

      Compiling a class with inner class, using the ClassName.this syntax causes an error in the compiler.

      The problem can be reproduced with following simple code fragment:

      class BrokenGroovy {
      
        def user = new Object() {
          def field = BrokenGroovy.this
        }
      }
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            denis_murashev Denis Murashev
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: