openrewrite / rewrite-kotlin

Work-in-progress implementation of Kotlin language support for OpenRewrite.
Apache License 2.0
43 stars 12 forks source link

PSI to FIR association issue: Incorrect on parent classes. #517

Closed traceyyoshima closed 9 months ago

traceyyoshima commented 9 months ago
                  class A {
                      class B {
                          class C
                      }
                  }
                  val c = A.B.C()

Both A and B will have the same type, A$B.

kunli2 commented 9 months ago

This is hard to resolve since A.B is the minimum granularity in the FIR, say it's like atomic from the FIR perspective, so distinguishing between A and B or more will require some additional algorithm on the FIR to break down the atomic nucleus into quarks. this is a even harder case than above

              class A {
                  class B {
                      class A {
                          class C
                      }
                  }
              }

              val x = A.B.A.C()