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

Implicit this fails to get passed correctly from one non-static inner class to another

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.5
    • 1.7.5
    • class generator
    • None

    Description

      class A {
          void foo() {
              new B().r()
          }
      
          class B {
              def r() {
                  new C("")
              }
          }
      
          class C {
              C(s) {}
          }
      }
      
      new A().foo()
      

      The code above fails with the following error

      Caught: groovy.lang.GroovyRuntimeException: Could not find matching constructor for: A$C(java.lang.String)
      	at A$B.r(TryGroovy.groovy:8)
      	at A.foo(TryGroovy.groovy:3)
      	at TryGroovy.run(TryGroovy.groovy:17)
      

      Attachments

        Activity

          People

            roshandawrani Roshan Dawrani
            roshandawrani Roshan Dawrani
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: