From 699eb47834d786677624590de608b1a9ac023749 Mon Sep 17 00:00:00 2001 From: Dmitry Savvinov Date: Tue, 7 Sep 2021 18:12:48 +0300 Subject: [PATCH] Never suggest fake overrides as results of expects-matching See KT-48291 for example. The rationale behind the change is that in "findExpectForActual" we want to find a candidate to be a counterpart for the current (actual) declaration. Fake overrides can not be a sensible counterpart in that regard (you can't, nor you should, provide actual for expect which is FAKE_OVERRIDE) ^KT-48291 Fixed --- .../kotlin/resolve/multiplatform/ExpectedActualResolver.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectedActualResolver.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectedActualResolver.kt index 0642e3cc4c4..6c10869d24d 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectedActualResolver.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/multiplatform/ExpectedActualResolver.kt @@ -87,7 +87,7 @@ object ExpectedActualResolver { } candidates.filter { declaration -> - actual != declaration && declaration.isExpect + actual != declaration && declaration.kind != CallableMemberDescriptor.Kind.FAKE_OVERRIDE && declaration.isExpect }.groupBy { declaration -> // TODO: optimize by caching this per actual-expected class pair, do not create a new substitutor for each actual member val substitutor =