From f08d4b8bb115638f03343ebe714184bacb391278 Mon Sep 17 00:00:00 2001 From: Kirill Rakhman Date: Mon, 4 Sep 2023 15:36:06 +0200 Subject: [PATCH] [FIR] Improve condition for sorting equivalent calls by source first This accommodates for declarations generated by plugins that don't have a source. --- .../fir/resolve/calls/jvm/ConeEquivalentCallConflictResolver.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/fir/java/src/org/jetbrains/kotlin/fir/resolve/calls/jvm/ConeEquivalentCallConflictResolver.kt b/compiler/fir/java/src/org/jetbrains/kotlin/fir/resolve/calls/jvm/ConeEquivalentCallConflictResolver.kt index 36e01bede33..0b2ca62d93e 100644 --- a/compiler/fir/java/src/org/jetbrains/kotlin/fir/resolve/calls/jvm/ConeEquivalentCallConflictResolver.kt +++ b/compiler/fir/java/src/org/jetbrains/kotlin/fir/resolve/calls/jvm/ConeEquivalentCallConflictResolver.kt @@ -44,7 +44,7 @@ class ConeEquivalentCallConflictResolver( // Since we can consider a declaration from source and one from binary equivalent, we need to make sure we favor the one from // source, otherwise we might get a behavior change to K1. // See org.jetbrains.kotlin.resolve.calls.results.OverloadingConflictResolver.filterOutEquivalentCalls. - val fromSourceFirst = candidates.sortedBy { it.symbol.fir.source == null } + val fromSourceFirst = candidates.sortedBy { it.symbol.fir.moduleData.session.kind != FirSession.Kind.Source } val result = mutableSetOf() outerLoop@ for (myCandidate in fromSourceFirst) {