From 22ccb7a943e645266d92f466fb9f78aab7de0060 Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Wed, 4 Aug 2021 11:30:25 +0300 Subject: [PATCH] FIR: discriminate generics during callable reference resolve --- .../intellij/DailyAggregatedDoubleFactor.fir.txt | 2 +- .../resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.kt | 2 +- .../fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.fir.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.fir.txt index 99f43264043..6e22fb631c8 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.fir.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.fir.txt @@ -5,5 +5,5 @@ FILE: DailyAggregatedDoubleFactor.kt ^aggregateBy R|kotlin/collections/mutableMapOf|() } public final fun R|DailyAggregatedDoubleFactor|.aggregateMin(): R|kotlin/collections/Map| { - ^aggregateMin this@R|/aggregateMin|.R|/aggregateBy|(::#) + ^aggregateMin this@R|/aggregateMin|.R|/aggregateBy|(::R|kotlin/comparisons/minOf|) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.kt index 9e9ea000daa..a07876b7866 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/intellij/DailyAggregatedDoubleFactor.kt @@ -4,4 +4,4 @@ private fun DailyAggregatedDoubleFactor.aggregateBy(reduce: (Double, Double) -> return mutableMapOf() } -fun DailyAggregatedDoubleFactor.aggregateMin(): Map = aggregateBy(::minOf) +fun DailyAggregatedDoubleFactor.aggregateMin(): Map = aggregateBy(::minOf) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt index 6b53d49e41f..b69aeeaf127 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt @@ -365,7 +365,7 @@ class FirCallResolver( val reducedCandidates = if (noSuccessfulCandidates) { bestCandidates.toSet() } else { - conflictResolver.chooseMaximallySpecificCandidates(bestCandidates, discriminateGenerics = false) + conflictResolver.chooseMaximallySpecificCandidates(bestCandidates, discriminateGenerics = true) } (callableReferenceAccess.explicitReceiver as? FirResolvedQualifier)?.replaceResolvedToCompanionObject(