72def186a3
The change is needed for the parallel resolution (^KT-55750), so we can resolve the declaration under a lock that is specific to this declaration. Previously, if LL FIR was resolving some FirClass, LL FIR resolved all its children too, and it had no control over what parts of the FIR tree were modified. The same applied to the designation path, sometimes the classes on the designation path might be unexpectedly (and without lock) modified. This commit introduces LLFirResolveTarget, which specifies which exact declarations should be resolved during the lazy resolution of the declaration. All elements outside the declarations specified for resolve in LLFirResolveTarget, should not be modified. The logic of lazy transformers is the following: - Go to target declaration collecting all scopes from the file and containing classes - Resolve only declarations that are specified by the LLFirResolveTarget, performing the resolve under a separate lock for each declaration ^KT-56543 ^KT-57619 Fixed
48 lines
702 B
Kotlin
Vendored
48 lines
702 B
Kotlin
Vendored
// !LANGUAGE: -ProhibitVisibilityOfNestedClassifiersFromSupertypesOfCompanion
|
|
|
|
// FILE: 1.kt
|
|
open class A {
|
|
class Y {
|
|
fun A_Y() {}
|
|
}
|
|
|
|
companion object {
|
|
class Z {
|
|
fun A_C_Z() {}
|
|
}
|
|
}
|
|
}
|
|
|
|
// FILE: B.java
|
|
public class B extends A {
|
|
class Y {
|
|
void B_Y() {}
|
|
}
|
|
|
|
class Z {
|
|
void B_Z() {}
|
|
}
|
|
}
|
|
|
|
// FILE: C.java
|
|
public class C extends A {}
|
|
|
|
// FILE: 2.kt
|
|
class E: B() {
|
|
init {
|
|
Y().B_Y()
|
|
Y().<!UNRESOLVED_REFERENCE!>A_Y<!>()
|
|
|
|
Z().B_Z()
|
|
Z().<!UNRESOLVED_REFERENCE!>A_C_Z<!>()
|
|
}
|
|
}
|
|
|
|
class Y: C() {
|
|
init {
|
|
Y().A_Y()
|
|
|
|
<!DEPRECATED_ACCESS_BY_SHORT_NAME!>Z()<!>.A_C_Z()
|
|
}
|
|
}
|