Analysis API: Implement KtCallResolver.collectAllCandidates for FE 1.0.
This commit is contained in:
committed by
Ilya Kirillov
parent
81a66258fa
commit
afb34d3193
+2
-2
@@ -65,9 +65,9 @@ fun createOverloadingConflictResolver(
|
||||
specificityComparator,
|
||||
platformOverloadsSpecificityComparator,
|
||||
cancellationChecker,
|
||||
MutableResolvedCall<*>::getResultingDescriptor,
|
||||
ResolvedCall<*>::getResultingDescriptor,
|
||||
ConstraintSystemBuilderImpl.Companion::forSpecificity,
|
||||
MutableResolvedCall<*>::createFlatSignature,
|
||||
ResolvedCall<*>::createFlatSignature,
|
||||
{ (it as? VariableAsFunctionResolvedCallImpl)?.variableCall },
|
||||
{ DescriptorToSourceUtils.descriptorToDeclaration(it) != null },
|
||||
null,
|
||||
|
||||
+2
-1
@@ -23,6 +23,7 @@ import org.jetbrains.kotlin.config.LanguageVersionSettings;
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.kotlin.descriptors.ModuleDescriptor;
|
||||
import org.jetbrains.kotlin.resolve.BindingTrace;
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall;
|
||||
import org.jetbrains.kotlin.resolve.calls.util.CallUtilKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.context.CallResolutionContext;
|
||||
import org.jetbrains.kotlin.resolve.calls.context.CheckArgumentTypesMode;
|
||||
@@ -40,7 +41,7 @@ import static org.jetbrains.kotlin.resolve.calls.results.ResolutionStatus.*;
|
||||
|
||||
public class ResolutionResultsHandler {
|
||||
|
||||
private final OverloadingConflictResolver<MutableResolvedCall<?>> overloadingConflictResolver;
|
||||
private final OverloadingConflictResolver<ResolvedCall<?>> overloadingConflictResolver;
|
||||
|
||||
public ResolutionResultsHandler(
|
||||
@NotNull KotlinBuiltIns builtIns,
|
||||
|
||||
+1
@@ -36,6 +36,7 @@ sealed class NewAbstractResolvedCall<D : CallableDescriptor> : ResolvedCall<D> {
|
||||
abstract val psiKotlinCall: PSIKotlinCall
|
||||
abstract val typeApproximator: TypeApproximator
|
||||
abstract val freshSubstitutor: FreshVariableNewTypeSubstitutor?
|
||||
abstract val diagnostics: Collection<KotlinCallDiagnostic>
|
||||
|
||||
protected open val positionDependentApproximation = false
|
||||
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ class NewCallableReferenceResolvedCall<D : CallableDescriptor>(
|
||||
) : NewAbstractResolvedCall<D>() {
|
||||
override val positionDependentApproximation: Boolean = true
|
||||
override val argumentMappingByOriginal: Map<ValueParameterDescriptor, ResolvedCallArgument> = emptyMap()
|
||||
override val diagnostics: Collection<KotlinCallDiagnostic> = emptyList()
|
||||
|
||||
override val resolvedCallAtom: ResolvedCallableReferenceCallAtom?
|
||||
get() = when (resolvedAtom) {
|
||||
|
||||
+4
-1
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
class NewResolvedCallImpl<D : CallableDescriptor>(
|
||||
override val resolvedCallAtom: ResolvedCallAtom,
|
||||
substitutor: NewTypeSubstitutor?,
|
||||
private var diagnostics: Collection<KotlinCallDiagnostic>,
|
||||
diagnostics: Collection<KotlinCallDiagnostic>,
|
||||
override val typeApproximator: TypeApproximator,
|
||||
override val languageVersionSettings: LanguageVersionSettings,
|
||||
) : NewAbstractResolvedCall<D>() {
|
||||
@@ -39,6 +39,9 @@ class NewResolvedCallImpl<D : CallableDescriptor>(
|
||||
override val argumentMappingByOriginal: Map<ValueParameterDescriptor, ResolvedCallArgument>
|
||||
get() = resolvedCallAtom.argumentMappingByOriginal
|
||||
|
||||
override var diagnostics: Collection<KotlinCallDiagnostic> = diagnostics
|
||||
private set
|
||||
|
||||
private lateinit var resultingDescriptor: D
|
||||
private lateinit var typeArguments: List<UnwrappedType>
|
||||
private var smartCastDispatchReceiverType: KotlinType? = null
|
||||
|
||||
+2
@@ -8,6 +8,7 @@ package org.jetbrains.kotlin.resolve.calls.tower
|
||||
import org.jetbrains.kotlin.descriptors.*
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.FreshVariableNewTypeSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.inference.components.NewTypeSubstitutor
|
||||
import org.jetbrains.kotlin.resolve.calls.model.KotlinCallDiagnostic
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCallAtom
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument
|
||||
import org.jetbrains.kotlin.resolve.calls.model.VariableAsFunctionResolvedCall
|
||||
@@ -28,6 +29,7 @@ class NewVariableAsFunctionResolvedCallImpl(
|
||||
override val argumentMappingByOriginal = functionCall.argumentMappingByOriginal
|
||||
override val kotlinCall = functionCall.kotlinCall
|
||||
override val languageVersionSettings = functionCall.languageVersionSettings
|
||||
override val diagnostics: Collection<KotlinCallDiagnostic> = functionCall.diagnostics
|
||||
|
||||
override fun getStatus() = functionCall.status
|
||||
override fun getCandidateDescriptor() = functionCall.candidateDescriptor
|
||||
|
||||
Reference in New Issue
Block a user