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

println "$this" fails in inner class, but println ''+this works

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.1
    • 1.7.3, 1.8-beta-1
    • None
    • None
    • linux, java 1.6

    Description

      class C {
        class S {
         //  S() { println "$this" } // compilation error: unexpected token: this
          S() { println ''+this } // OK
        }
      }
      

      Attachments

        Issue Links

          Activity

            People

              roshandawrani Roshan Dawrani
              mlzarathustra miles zarathustra
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: