From f1803b49feeabdd0c70f3cee47cb3787e27f7a2d Mon Sep 17 00:00:00 2001 From: Victor Petukhov Date: Mon, 20 Sep 2021 15:09:19 +0300 Subject: [PATCH] Extract `KotlinCallKind` into separate file --- .../resolve/calls/model/KotlinCallKind.kt | 64 +++++++++++++++++++ .../calls/model/KotlinResolverContext.kt | 47 -------------- 2 files changed, 64 insertions(+), 47 deletions(-) create mode 100644 compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallKind.kt diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallKind.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallKind.kt new file mode 100644 index 00000000000..91bfaf965c6 --- /dev/null +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinCallKind.kt @@ -0,0 +1,64 @@ +/* + * Copyright 2010-2021 JetBrains s.r.o. and Kotlin Programming Language contributors. + * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.resolve.calls.model + +import org.jetbrains.kotlin.resolve.calls.components.ArgumentsToCandidateParameterDescriptor +import org.jetbrains.kotlin.resolve.calls.components.CheckArgumentsInParenthesis +import org.jetbrains.kotlin.resolve.calls.components.CheckCallableReference +import org.jetbrains.kotlin.resolve.calls.components.CheckExplicitReceiverKindConsistency +import org.jetbrains.kotlin.resolve.calls.components.CheckExternalArgument +import org.jetbrains.kotlin.resolve.calls.components.CheckInfixResolutionPart +import org.jetbrains.kotlin.resolve.calls.components.CheckOperatorResolutionPart +import org.jetbrains.kotlin.resolve.calls.components.CheckReceivers +import org.jetbrains.kotlin.resolve.calls.components.CheckSuperExpressionCallPart +import org.jetbrains.kotlin.resolve.calls.components.CheckVisibility +import org.jetbrains.kotlin.resolve.calls.components.CollectionTypeVariableUsagesInfo +import org.jetbrains.kotlin.resolve.calls.components.CompatibilityOfPartiallyApplicableSamConversion +import org.jetbrains.kotlin.resolve.calls.components.CompatibilityOfTypeVariableAsIntersectionTypePart +import org.jetbrains.kotlin.resolve.calls.components.CreateFreshVariablesSubstitutor +import org.jetbrains.kotlin.resolve.calls.components.EagerResolveOfCallableReferences +import org.jetbrains.kotlin.resolve.calls.components.MapArguments +import org.jetbrains.kotlin.resolve.calls.components.MapTypeArguments +import org.jetbrains.kotlin.resolve.calls.components.NoArguments +import org.jetbrains.kotlin.resolve.calls.components.NoTypeArguments +import org.jetbrains.kotlin.resolve.calls.components.PostponedVariablesInitializerResolutionPart + +enum class KotlinCallKind(vararg resolutionPart: ResolutionPart) { + VARIABLE( + CheckVisibility, + CheckSuperExpressionCallPart, + NoTypeArguments, + NoArguments, + CreateFreshVariablesSubstitutor, + CollectionTypeVariableUsagesInfo, + CheckExplicitReceiverKindConsistency, + CheckReceivers, + PostponedVariablesInitializerResolutionPart + ), + FUNCTION( + CheckVisibility, + CheckInfixResolutionPart, + CheckOperatorResolutionPart, + CheckSuperExpressionCallPart, + MapTypeArguments, + MapArguments, + ArgumentsToCandidateParameterDescriptor, + CreateFreshVariablesSubstitutor, + CollectionTypeVariableUsagesInfo, + CheckExplicitReceiverKindConsistency, + CheckReceivers, + CheckArgumentsInParenthesis, + CheckExternalArgument, + EagerResolveOfCallableReferences, + CompatibilityOfTypeVariableAsIntersectionTypePart, + CompatibilityOfPartiallyApplicableSamConversion, + PostponedVariablesInitializerResolutionPart + ), + INVOKE(*FUNCTION.resolutionSequence.toTypedArray()), + UNSUPPORTED(); + + val resolutionSequence = resolutionPart.asList() +} \ No newline at end of file diff --git a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinResolverContext.kt b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinResolverContext.kt index 924d3974c5a..57d71ec95cc 100644 --- a/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinResolverContext.kt +++ b/compiler/resolution/src/org/jetbrains/kotlin/resolve/calls/model/KotlinResolverContext.kt @@ -47,53 +47,6 @@ class KotlinCallComponents( val callableReferenceArgumentResolver: CallableReferenceArgumentResolver ) -enum class KotlinCallKind(vararg resolutionPart: ResolutionPart) { - VARIABLE( - CheckVisibility, - CheckSuperExpressionCallPart, - NoTypeArguments, - NoArguments, - CreateFreshVariablesSubstitutor, - CollectionTypeVariableUsagesInfo, - CheckExplicitReceiverKindConsistency, - CheckReceivers, - PostponedVariablesInitializerResolutionPart - ), - FUNCTION( - CheckVisibility, - CheckInfixResolutionPart, - CheckOperatorResolutionPart, - CheckSuperExpressionCallPart, - MapTypeArguments, - MapArguments, - ArgumentsToCandidateParameterDescriptor, - CreateFreshVariablesSubstitutor, - CollectionTypeVariableUsagesInfo, - CheckExplicitReceiverKindConsistency, - CheckReceivers, - CheckArgumentsInParenthesis, - CheckExternalArgument, - EagerResolveOfCallableReferences, - CompatibilityOfTypeVariableAsIntersectionTypePart, - CompatibilityOfPartiallyApplicableSamConversion, - PostponedVariablesInitializerResolutionPart - ), - INVOKE(*FUNCTION.resolutionSequence.toTypedArray()), - CALLABLE_REFERENCE( - CheckVisibility, - NoTypeArguments, - NoArguments, - CreateFreshVariablesSubstitutor, - CollectionTypeVariableUsagesInfo, - CheckReceivers, - CheckCallableReference, - CompatibilityOfTypeVariableAsIntersectionTypePart - ), - UNSUPPORTED(); - - val resolutionSequence = resolutionPart.asList() -} - class GivenCandidate( val descriptor: FunctionDescriptor, val dispatchReceiver: ReceiverValueWithSmartCastInfo?,