[FIR] Reuse expect/actual matching data of outer declarations during matching of inner declarations
Review: https://jetbrains.team/p/kt/reviews/13244 Motivation: ``` // Module :lib class Foo { val member: Int = 2 } // Module :app // dependencies { implementation(project(":lib")) } class Foo { val member: Int = 2 } ``` Before the commit: app_Foo.expectForActual is `null` app_Foo.member.expectForActual = lib_foo.member After the commit: app_Foo.expectForActual is `null` app_Foo.member.expectForActual is `null` If I don't fix this problem then `CommonizerHierarchicalIT.testCommonizeHierarchicallyMultiModule` becomes red after I fix KT-59887 in the following commits `app_Foo.member.expectForActual = lib_foo.member` happens because we also need to match fake-overrides (KT-63550) I didn't measure it, but theoretically, this commit should be a performance improvement, becuase we reuse `expectForActual` cache Additionally, The commit breaks some other tests (e.g. compiler/testData/diagnostics/tests/multiplatform/headerClass/actualMissing.fir.kt). The tests will become green again, once I fix KT-59887
This commit is contained in:
+1
-1
@@ -46,7 +46,7 @@ actual class Bar5 {
|
||||
}
|
||||
|
||||
class Bar6 {
|
||||
actual constructor()
|
||||
<!ACTUAL_WITHOUT_EXPECT!>actual constructor()<!>
|
||||
}
|
||||
|
||||
actual class Bar7 actual constructor(s: String) {
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ expect class A {
|
||||
// FILE: jvm.kt
|
||||
|
||||
class A {
|
||||
actual fun foo() {}
|
||||
actual fun <!ACTUAL_WITHOUT_EXPECT!>foo<!>() {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user