diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index 84bd92c2583..17ef4ed5510 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -34,9 +34,9 @@ fun main() { foo3(KotlinClass::baz) // Type mismatch - foo1(KotlinClass::bar) + foo1(KotlinClass::bar) foo2(KotlinClass::bar) - foo3(KotlinClass::bar) + foo3(KotlinClass::bar) foo1(KotlinClass2::bar) // Type mismatch diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt index 7dd469aa84b..57992cb5075 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt @@ -50,13 +50,13 @@ FILE: main.kt public final fun foo3(x: R|(kotlin/String) -> kotlin/Int|): R|kotlin/Unit| { } public final fun main(): R|kotlin/Unit| { - R|/foo1|(Q|KotlinClass|::R|/KotlinClass.baz|) + R|/foo1|(Q|KotlinClass|::R|/KotlinClass.Companion.baz|) R|/foo2|(Q|KotlinClass|::R|/KotlinClass.baz|) #(Q|KotlinClass|::R|/KotlinClass.baz|) - R|/foo1|(Q|KotlinClass|::R|/JavaClass.bar|) + #(Q|KotlinClass|::#) R|/foo2|(Q|KotlinClass|::R|/JavaClass.bar|) - #(Q|KotlinClass|::R|/JavaClass.bar|) - R|/foo1|(Q|KotlinClass2|::R|/KotlinClass2.bar|) + R|/foo3|(Q|KotlinClass|::R|/JavaClass.bar|) + R|/foo1|(Q|KotlinClass2|::R|/KotlinClass2.Companion.bar|) #(Q|KotlinClass2|::#) - R|/foo3|(Q|KotlinClass2|::R|/KotlinClass2.bar|) + R|/foo3|(Q|KotlinClass2|::R|/KotlinClass2.Companion.bar|) } 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 898f0f7009d..50e01c9e118 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt @@ -9,7 +9,6 @@ import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.fir.declarations.* import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic import org.jetbrains.kotlin.fir.expressions.* -import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionStub import org.jetbrains.kotlin.fir.expressions.builder.buildResolvedReifiedParameterReference import org.jetbrains.kotlin.fir.references.* import org.jetbrains.kotlin.fir.references.builder.buildBackingFieldReference @@ -400,7 +399,9 @@ class FirCallResolver( } } if (constructorSymbol == null) return null - val candidate = CandidateFactory(transformer.resolutionContext, callInfo).createCandidate( + val candidateFactory = CandidateFactory(transformer.resolutionContext, callInfo) + val candidate = candidateFactory.createCandidate( + callInfo, constructorSymbol!!, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, scope = null @@ -471,12 +472,6 @@ class FirCallResolver( expectedType, outerConstraintSystemBuilder, lhs, - stubReceiver = if (lhs !is DoubleColonLHS.Type) null else buildExpressionStub { - source = callableReferenceAccess.source - typeRef = buildResolvedTypeRef { - type = lhs.type - } - }, ) } @@ -547,7 +542,7 @@ class FirCallResolver( source: FirSourceElement?, name: Name ): FirErrorReferenceWithCandidate { - val candidate = CandidateFactory(transformer.resolutionContext, callInfo).createErrorCandidate(diagnostic) + val candidate = CandidateFactory(transformer.resolutionContext, callInfo).createErrorCandidate(callInfo, diagnostic) components.resolutionStageRunner.processCandidate(candidate, transformer.resolutionContext, stopOnFirstError = false) return FirErrorReferenceWithCandidate(source, name, candidate, diagnostic) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt index f5324ae66f3..91096caae85 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt @@ -52,16 +52,12 @@ data class CallInfo( // Four properties for callable references only val expectedType: ConeKotlinType? = null, val outerCSBuilder: ConstraintSystemBuilder? = null, - val lhs: DoubleColonLHS? = null, - val stubReceiver: FirExpression? = null + val lhs: DoubleColonLHS? = null ) { val arguments: List get() = argumentList.arguments val argumentCount get() = arguments.size - fun noStubReceiver(): CallInfo = - if (stubReceiver == null) this else copy(stubReceiver = null) - fun replaceWithVariableAccess(): CallInfo = copy(callKind = CallKind.VariableAccess, typeArguments = emptyList(), argumentList = FirEmptyArgumentList) diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt index 90c04fb789a..0b55ef668ab 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/CandidateFactory.kt @@ -22,7 +22,6 @@ import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind class CandidateFactory private constructor( val context: ResolutionContext, - val callInfo: CallInfo, private val baseSystem: ConstraintStorage ) { @@ -37,17 +36,10 @@ class CandidateFactory private constructor( } } - constructor(context: ResolutionContext, callInfo: CallInfo) : - this(context, callInfo, buildBaseSystem(context, callInfo)) - - fun replaceCallInfo(callInfo: CallInfo): CandidateFactory { - if (this.callInfo.arguments.size != callInfo.arguments.size) { - throw AssertionError("Incorrect replacement of call info in CandidateFactory") - } - return CandidateFactory(context, callInfo, baseSystem) - } + constructor(context: ResolutionContext, callInfo: CallInfo) : this(context, buildBaseSystem(context, callInfo)) fun createCandidate( + callInfo: CallInfo, symbol: AbstractFirBasedSymbol<*>, explicitReceiverKind: ExplicitReceiverKind, scope: FirScope?, @@ -65,7 +57,7 @@ class CandidateFactory private constructor( ) } - fun createErrorCandidate(diagnostic: ConeDiagnostic): Candidate { + fun createErrorCandidate(callInfo: CallInfo, diagnostic: ConeDiagnostic): Candidate { val symbol: AbstractFirBasedSymbol<*> = when (callInfo.callKind) { is CallKind.VariableAccess -> createErrorPropertySymbol(diagnostic) is CallKind.Function, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt index 6c4e401f8e6..fb199e89b79 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirInvokeResolveTowerExtension.kt @@ -245,7 +245,6 @@ internal class FirInvokeResolveTowerExtension( receiverGroup, candidateFactoriesAndCollectors.resultCollector, candidateFactory, - candidateFactoriesAndCollectors.stubReceiverCandidateFactory ) } @@ -307,7 +306,6 @@ private class InvokeReceiverResolveTask( towerDataElementsForName, collector, candidateFactory, - stubReceiverCandidateFactory = null ) { override fun interceptTowerGroup(towerGroup: TowerGroup): TowerGroup = towerGroup.InvokeResolvePriority(InvokeResolvePriority.INVOKE_RECEIVER) @@ -324,14 +322,12 @@ private class InvokeFunctionResolveTask( private val receiverGroup: TowerGroup, collector: CandidateCollector, candidateFactory: CandidateFactory, - stubReceiverCandidateFactory: CandidateFactory? = null ) : FirBaseTowerResolveTask( components, manager, towerDataElementsForName, collector, candidateFactory, - stubReceiverCandidateFactory ) { override fun interceptTowerGroup(towerGroup: TowerGroup): TowerGroup = diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolveTask.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolveTask.kt index 9c6eef73515..5d1d8bfde07 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolveTask.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolveTask.kt @@ -9,12 +9,15 @@ import org.jetbrains.kotlin.fir.asReversedFrozen import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.FirQualifiedAccessExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier +import org.jetbrains.kotlin.fir.expressions.builder.buildExpressionStub import org.jetbrains.kotlin.fir.resolve.BodyResolveComponents +import org.jetbrains.kotlin.fir.resolve.DoubleColonLHS import org.jetbrains.kotlin.fir.resolve.FirTowerDataContext import org.jetbrains.kotlin.fir.resolve.calls.* import org.jetbrains.kotlin.fir.scopes.FirScope import org.jetbrains.kotlin.fir.scopes.ProcessorAction import org.jetbrains.kotlin.fir.types.* +import org.jetbrains.kotlin.fir.types.builder.buildResolvedTypeRef import org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind @@ -53,8 +56,7 @@ internal abstract class FirBaseTowerResolveTask( private val manager: TowerResolveManager, protected val towerDataElementsForName: TowerDataElementsForName, private val collector: CandidateCollector, - private val candidateFactory: CandidateFactory, - private val stubReceiverCandidateFactory: CandidateFactory? = null + private val candidateFactory: CandidateFactory ) { protected val session get() = components.session @@ -131,7 +133,6 @@ internal abstract class FirBaseTowerResolveTask( val result = handler.handleLevel( collector, candidateFactory, - stubReceiverCandidateFactory, callInfo, explicitReceiverKind, finalGroup, @@ -149,14 +150,12 @@ internal open class FirTowerResolveTask( towerDataElementsForName: TowerDataElementsForName, collector: CandidateCollector, candidateFactory: CandidateFactory, - stubReceiverCandidateFactory: CandidateFactory? = null ) : FirBaseTowerResolveTask( components, manager, towerDataElementsForName, collector, candidateFactory, - stubReceiverCandidateFactory ) { suspend fun runResolverForQualifierReceiver( @@ -178,8 +177,17 @@ internal open class FirTowerResolveTask( if (resolvedQualifier.symbol != null) { val typeRef = resolvedQualifier.typeRef - if (info.callKind == CallKind.CallableReference && info.stubReceiver != null ) { - runResolverForExpressionReceiver(info, info.stubReceiver, parentGroup = TowerGroup.QualifierValue) + if (info.callKind == CallKind.CallableReference && info.lhs is DoubleColonLHS.Type) { + val stubReceiver = buildExpressionStub { + source = info.explicitReceiver?.source + this.typeRef = buildResolvedTypeRef { + type = info.lhs.type + } + } + + val stubReceiverInfo = info.replaceExplicitReceiver(stubReceiver) + + runResolverForExpressionReceiver(stubReceiverInfo, stubReceiver, parentGroup = TowerGroup.QualifierValue) } // NB: yet built-in Unit is used for "no-value" type @@ -197,7 +205,7 @@ internal open class FirTowerResolveTask( val callableScope = qualifierReceiver.callableScope() ?: return processLevel( callableScope.toScopeTowerLevel(includeInnerConstructors = false), - info.noStubReceiver(), TowerGroup.Qualifier + info, TowerGroup.Qualifier ) } @@ -212,7 +220,7 @@ internal open class FirTowerResolveTask( val scope = qualifierReceiver.classifierScope() ?: return val group = if (prioritized) TowerGroup.ClassifierPrioritized else TowerGroup.Classifier processLevel( - scope.toScopeTowerLevel(includeInnerConstructors = false), info.noStubReceiver(), + scope.toScopeTowerLevel(includeInnerConstructors = false), info, group ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolver.kt index ffb38b1c1fa..48d0ac06de7 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/FirTowerResolver.kt @@ -52,7 +52,6 @@ class FirTowerResolver( TowerDataElementsForName(info.name, components.towerDataContext), candidateFactoriesAndCollectors.resultCollector, candidateFactoriesAndCollectors.candidateFactory, - candidateFactoriesAndCollectors.stubReceiverCandidateFactory ) when (val receiver = info.explicitReceiver) { is FirResolvedQualifier -> { @@ -103,6 +102,7 @@ class FirTowerResolver( resultCollector.consumeCandidate( TowerGroup.Member, candidateFactory.createCandidate( + info, it, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, scope, @@ -123,16 +123,10 @@ class FirTowerResolver( context: ResolutionContext ): CandidateFactoriesAndCollectors { val candidateFactory = CandidateFactory(context, info) - val stubReceiverCandidateFactory = - if (info.callKind == CallKind.CallableReference && info.stubReceiver != null) - candidateFactory.replaceCallInfo(info.replaceExplicitReceiver(info.stubReceiver)) - else - null return CandidateFactoriesAndCollectors( candidateFactory, - collector, - stubReceiverCandidateFactory + collector ) } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerLevelHandler.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerLevelHandler.kt index 6390acef981..754b641da99 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerLevelHandler.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/tower/TowerLevelHandler.kt @@ -5,7 +5,6 @@ package org.jetbrains.kotlin.fir.resolve.calls.tower -import org.jetbrains.kotlin.fir.expressions.FirExpression import org.jetbrains.kotlin.fir.expressions.FirResolvedQualifier import org.jetbrains.kotlin.fir.resolve.calls.* import org.jetbrains.kotlin.fir.scopes.FirScope @@ -18,7 +17,6 @@ import org.jetbrains.kotlin.fir.types.ConeClassLikeType import org.jetbrains.kotlin.fir.types.ConeStarProjection import org.jetbrains.kotlin.fir.types.coneType import org.jetbrains.kotlin.fir.types.constructClassType -import org.jetbrains.kotlin.fir.types.impl.FirImplicitBuiltinTypeRef import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind import org.jetbrains.kotlin.types.AbstractTypeChecker @@ -27,9 +25,6 @@ internal class CandidateFactoriesAndCollectors( // Common calls val candidateFactory: CandidateFactory, val resultCollector: CandidateCollector, - - // Callable references - val stubReceiverCandidateFactory: CandidateFactory?, ) @@ -41,7 +36,6 @@ internal class TowerLevelHandler { fun handleLevel( collector: CandidateCollector, candidateFactory: CandidateFactory, - stubReceiverCandidateFactory: CandidateFactory? = null, info: CallInfo, explicitReceiverKind: ExplicitReceiverKind, group: TowerGroup, @@ -50,7 +44,7 @@ internal class TowerLevelHandler { processResult = ProcessorAction.NONE val processor = TowerScopeLevelProcessor( - info.explicitReceiver, + info, explicitReceiverKind, collector, candidateFactory, @@ -69,22 +63,7 @@ internal class TowerLevelHandler { towerLevel.processFunctions(info.name, processor) } CallKind.CallableReference -> { - val stubReceiver = info.stubReceiver - if (stubReceiver != null) { - val stubProcessor = TowerScopeLevelProcessor( - info.explicitReceiver, - explicitReceiverKind, - collector, - stubReceiverCandidateFactory!!, group - ) - towerLevel.processFunctionsAndProperties(info.name, stubProcessor) - // NB: we don't perform this for implicit Unit - if (!collector.isSuccess() && info.explicitReceiver?.typeRef !is FirImplicitBuiltinTypeRef) { - towerLevel.processFunctionsAndProperties(info.name, processor) - } - } else { - towerLevel.processFunctionsAndProperties(info.name, processor) - } + towerLevel.processFunctionsAndProperties(info.name, processor) } else -> { throw AssertionError("Unsupported call kind in tower resolver: ${info.callKind}") @@ -135,7 +114,7 @@ internal class TowerLevelHandler { } private class TowerScopeLevelProcessor( - val explicitReceiver: FirExpression?, + val callInfo: CallInfo, val explicitReceiverKind: ExplicitReceiverKind, val resultCollector: CandidateCollector, val candidateFactory: CandidateFactory, @@ -151,7 +130,7 @@ private class TowerScopeLevelProcessor( // Check explicit extension receiver for default package members if (symbol is FirNamedFunctionSymbol && dispatchReceiverValue == null && extensionReceiverValue != null && - explicitReceiver !is FirResolvedQualifier && + callInfo.explicitReceiver !is FirResolvedQualifier && symbol.callableId.packageName.startsWith(defaultPackage) ) { val extensionReceiverType = extensionReceiverValue.type as? ConeClassLikeType @@ -175,6 +154,7 @@ private class TowerScopeLevelProcessor( // --- resultCollector.consumeCandidate( group, candidateFactory.createCandidate( + callInfo, symbol, explicitReceiverKind, scope, diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt index fedc5fc9b95..103949d3eb2 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/FirSyntheticCallGenerator.kt @@ -172,12 +172,15 @@ class FirSyntheticCallGenerator( return FirNamedReferenceWithCandidate(null, name, candidate) } - private fun generateCandidate(callInfo: CallInfo, function: FirSimpleFunction, context: ResolutionContext): Candidate = - CandidateFactory(context, callInfo).createCandidate( + private fun generateCandidate(callInfo: CallInfo, function: FirSimpleFunction, context: ResolutionContext): Candidate { + val candidateFactory = CandidateFactory(context, callInfo) + return candidateFactory.createCandidate( + callInfo, symbol = function.symbol, explicitReceiverKind = ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, scope = null ) + } private fun generateCallInfo(name: Name, argumentList: FirArgumentList, callKind: CallKind) = CallInfo( callKind = callKind, diff --git a/compiler/testData/codegen/box/callableReference/function/referenceToCompanionMember.kt b/compiler/testData/codegen/box/callableReference/function/referenceToCompanionMember.kt index 77854546b0a..3be2c51a9dd 100644 --- a/compiler/testData/codegen/box/callableReference/function/referenceToCompanionMember.kt +++ b/compiler/testData/codegen/box/callableReference/function/referenceToCompanionMember.kt @@ -1,7 +1,6 @@ // DONT_TARGET_EXACT_BACKEND: WASM // WASM_MUTE_REASON: BINDING_RECEIVERS // WITH_RUNTIME -// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND: JS class A { diff --git a/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassName.kt b/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassName.kt index cff0c2c0b0e..1bcd9630ecb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassName.kt +++ b/compiler/testData/diagnostics/tests/callableReference/referenceToCompanionObjectMemberViaClassName.kt @@ -27,7 +27,7 @@ fun testA(a: A) { fun testB(b: B) { val call1 = call(B::foo) - call1 + call1 val call2 = call(B()::foo) call2 diff --git a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt index 54a6cbc882e..a8516c5a43e 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt @@ -186,7 +186,7 @@ fun main() { // Should be error as `A3::foo1` is `KFunction2`, but the remaining arguments are `KFuncion1` or `Function1` ")!>select(A3(), ")!>A3::foo1, { a -> a }, { it -> it }) // It's OK because `A3::foo2` is from companion of `A3` - ")!>select(A3(), ")!>A3::foo2, { a -> a }, { it -> it }) + ")!>select(A3(), ")!>A3::foo2, { a -> a }, { it -> it }) & java.io.Serializable>")!>select(A4(), { x: Number -> "" }) & java.io.Serializable>")!>select(A5(), { x: Number, y: Int -> "" }) ")!>select(A2(), id { a, b, c -> a; b; c }) diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt index 4b17a42c762..a8fd4601329 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/resolving-callable-references-not-used-as-arguments-to-a-call/p-1/pos/1.2.fir.kt @@ -11,7 +11,7 @@ import libCase1.* import kotlin.text.format fun case1() { - val y2 : () ->String =(String)::format + val y2 : () ->String =(String)::format } // FILE: LibCase1.kt diff --git a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/resolver/SingleCandidateResolver.kt b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/resolver/SingleCandidateResolver.kt index da9904b68b7..92fac2677f1 100644 --- a/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/resolver/SingleCandidateResolver.kt +++ b/idea/idea-frontend-fir/idea-fir-low-level-api/src/org/jetbrains/kotlin/idea/fir/low/level/api/resolver/SingleCandidateResolver.kt @@ -65,6 +65,7 @@ class SingleCandidateResolver( val resolutionContext = stubBodyResolveTransformer.resolutionContext val candidate = CandidateFactory(resolutionContext, callInfo).createCandidate( + callInfo, resolutionParameters.callableSymbol, explicitReceiverKind = explicitReceiverKind, dispatchReceiverValue = dispatchReceiverValue,