Rename the old inference ResolutionCandidate to OldResolutionCandidate
This commit is contained in:
@@ -43,7 +43,7 @@ import org.jetbrains.kotlin.resolve.calls.model.*
|
|||||||
import org.jetbrains.kotlin.resolve.calls.resolvedCallUtil.getExplicitReceiverValue
|
import org.jetbrains.kotlin.resolve.calls.resolvedCallUtil.getExplicitReceiverValue
|
||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
|
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
|
||||||
import org.jetbrains.kotlin.resolve.findTopMostOverriddenDescriptors
|
import org.jetbrains.kotlin.resolve.findTopMostOverriddenDescriptors
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue
|
||||||
@@ -102,7 +102,7 @@ fun getExpectedTypePredicate(
|
|||||||
val predicates = ArrayList<TypePredicate>()
|
val predicates = ArrayList<TypePredicate>()
|
||||||
|
|
||||||
for (candidate in candidates) {
|
for (candidate in candidates) {
|
||||||
val resolutionCandidate = ResolutionCandidate.create(
|
val resolutionCandidate = OldResolutionCandidate.create(
|
||||||
call,
|
call,
|
||||||
candidate,
|
candidate,
|
||||||
null,
|
null,
|
||||||
|
|||||||
@@ -218,7 +218,7 @@ public class CallResolver {
|
|||||||
private <D extends FunctionDescriptor> OverloadResolutionResults<D> computeTasksFromCandidatesAndResolvedCall(
|
private <D extends FunctionDescriptor> OverloadResolutionResults<D> computeTasksFromCandidatesAndResolvedCall(
|
||||||
@NotNull BasicCallResolutionContext context,
|
@NotNull BasicCallResolutionContext context,
|
||||||
@NotNull KtReferenceExpression referenceExpression,
|
@NotNull KtReferenceExpression referenceExpression,
|
||||||
@NotNull Collection<ResolutionCandidate<D>> candidates
|
@NotNull Collection<OldResolutionCandidate<D>> candidates
|
||||||
) {
|
) {
|
||||||
return computeTasksFromCandidatesAndResolvedCall(context, candidates,
|
return computeTasksFromCandidatesAndResolvedCall(context, candidates,
|
||||||
TracingStrategyImpl.create(referenceExpression, context.call));
|
TracingStrategyImpl.create(referenceExpression, context.call));
|
||||||
@@ -227,7 +227,7 @@ public class CallResolver {
|
|||||||
@NotNull
|
@NotNull
|
||||||
private <D extends FunctionDescriptor> OverloadResolutionResults<D> computeTasksFromCandidatesAndResolvedCall(
|
private <D extends FunctionDescriptor> OverloadResolutionResults<D> computeTasksFromCandidatesAndResolvedCall(
|
||||||
@NotNull BasicCallResolutionContext context,
|
@NotNull BasicCallResolutionContext context,
|
||||||
@NotNull Collection<ResolutionCandidate<D>> candidates,
|
@NotNull Collection<OldResolutionCandidate<D>> candidates,
|
||||||
@NotNull TracingStrategy tracing
|
@NotNull TracingStrategy tracing
|
||||||
) {
|
) {
|
||||||
return callResolvePerfCounter.<OverloadResolutionResults<D>>time(() -> {
|
return callResolvePerfCounter.<OverloadResolutionResults<D>>time(() -> {
|
||||||
@@ -261,8 +261,8 @@ public class CallResolver {
|
|||||||
@NotNull Collection<FunctionDescriptor> functionDescriptors
|
@NotNull Collection<FunctionDescriptor> functionDescriptors
|
||||||
) {
|
) {
|
||||||
BasicCallResolutionContext callResolutionContext = BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS);
|
BasicCallResolutionContext callResolutionContext = BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS);
|
||||||
List<ResolutionCandidate<FunctionDescriptor>> candidates = CollectionsKt.map(functionDescriptors, descriptor ->
|
List<OldResolutionCandidate<FunctionDescriptor>> candidates = CollectionsKt.map(functionDescriptors, descriptor ->
|
||||||
ResolutionCandidate.create(
|
OldResolutionCandidate.create(
|
||||||
call,
|
call,
|
||||||
descriptor,
|
descriptor,
|
||||||
null,
|
null,
|
||||||
@@ -282,8 +282,8 @@ public class CallResolver {
|
|||||||
@NotNull Collection<FunctionDescriptor> functionDescriptors
|
@NotNull Collection<FunctionDescriptor> functionDescriptors
|
||||||
) {
|
) {
|
||||||
BasicCallResolutionContext callResolutionContext = BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS);
|
BasicCallResolutionContext callResolutionContext = BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS);
|
||||||
List<ResolutionCandidate<FunctionDescriptor>> resolutionCandidates = CollectionsKt.map(functionDescriptors, descriptor ->
|
List<OldResolutionCandidate<FunctionDescriptor>> resolutionCandidates = CollectionsKt.map(functionDescriptors, descriptor ->
|
||||||
ResolutionCandidate.create(
|
OldResolutionCandidate.create(
|
||||||
call, descriptor, receiver, ExplicitReceiverKind.DISPATCH_RECEIVER, null));
|
call, descriptor, receiver, ExplicitReceiverKind.DISPATCH_RECEIVER, null));
|
||||||
|
|
||||||
return computeTasksFromCandidatesAndResolvedCall(
|
return computeTasksFromCandidatesAndResolvedCall(
|
||||||
@@ -412,10 +412,10 @@ public class CallResolver {
|
|||||||
@NotNull KtReferenceExpression functionReference,
|
@NotNull KtReferenceExpression functionReference,
|
||||||
@NotNull KotlinType constructedType
|
@NotNull KotlinType constructedType
|
||||||
) {
|
) {
|
||||||
Pair<Collection<ResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> candidatesAndContext =
|
Pair<Collection<OldResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> candidatesAndContext =
|
||||||
prepareCandidatesAndContextForConstructorCall(constructedType, context, syntheticScopes);
|
prepareCandidatesAndContextForConstructorCall(constructedType, context, syntheticScopes);
|
||||||
|
|
||||||
Collection<ResolutionCandidate<ConstructorDescriptor>> candidates = candidatesAndContext.getFirst();
|
Collection<OldResolutionCandidate<ConstructorDescriptor>> candidates = candidatesAndContext.getFirst();
|
||||||
context = candidatesAndContext.getSecond();
|
context = candidatesAndContext.getSecond();
|
||||||
|
|
||||||
return computeTasksFromCandidatesAndResolvedCall(context, functionReference, candidates);
|
return computeTasksFromCandidatesAndResolvedCall(context, functionReference, candidates);
|
||||||
@@ -502,9 +502,9 @@ public class CallResolver {
|
|||||||
KotlinType superType =
|
KotlinType superType =
|
||||||
isThisCall ? currentClassDescriptor.getDefaultType() : DescriptorUtils.getSuperClassType(currentClassDescriptor);
|
isThisCall ? currentClassDescriptor.getDefaultType() : DescriptorUtils.getSuperClassType(currentClassDescriptor);
|
||||||
|
|
||||||
Pair<Collection<ResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> candidatesAndContext =
|
Pair<Collection<OldResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> candidatesAndContext =
|
||||||
prepareCandidatesAndContextForConstructorCall(superType, context, syntheticScopes);
|
prepareCandidatesAndContextForConstructorCall(superType, context, syntheticScopes);
|
||||||
Collection<ResolutionCandidate<ConstructorDescriptor>> candidates = candidatesAndContext.getFirst();
|
Collection<OldResolutionCandidate<ConstructorDescriptor>> candidates = candidatesAndContext.getFirst();
|
||||||
context = candidatesAndContext.getSecond();
|
context = candidatesAndContext.getSecond();
|
||||||
|
|
||||||
TracingStrategy tracing = call.isImplicit() ?
|
TracingStrategy tracing = call.isImplicit() ?
|
||||||
@@ -529,13 +529,13 @@ public class CallResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static Pair<Collection<ResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> prepareCandidatesAndContextForConstructorCall(
|
private static Pair<Collection<OldResolutionCandidate<ConstructorDescriptor>>, BasicCallResolutionContext> prepareCandidatesAndContextForConstructorCall(
|
||||||
@NotNull KotlinType superType,
|
@NotNull KotlinType superType,
|
||||||
@NotNull BasicCallResolutionContext context,
|
@NotNull BasicCallResolutionContext context,
|
||||||
@NotNull SyntheticScopes syntheticScopes
|
@NotNull SyntheticScopes syntheticScopes
|
||||||
) {
|
) {
|
||||||
if (!(superType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor)) {
|
if (!(superType.getConstructor().getDeclarationDescriptor() instanceof ClassDescriptor)) {
|
||||||
return new Pair<>(Collections.<ResolutionCandidate<ConstructorDescriptor>>emptyList(), context);
|
return new Pair<>(Collections.<OldResolutionCandidate<ConstructorDescriptor>>emptyList(), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If any constructor has type parameter (currently it only can be true for ones from Java), try to infer arguments for them
|
// If any constructor has type parameter (currently it only can be true for ones from Java), try to infer arguments for them
|
||||||
@@ -547,7 +547,7 @@ public class CallResolver {
|
|||||||
context = context.replaceExpectedType(superType);
|
context = context.replaceExpectedType(superType);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<ResolutionCandidate<ConstructorDescriptor>> candidates =
|
List<OldResolutionCandidate<ConstructorDescriptor>> candidates =
|
||||||
CallResolverUtilKt.createResolutionCandidatesForConstructors(
|
CallResolverUtilKt.createResolutionCandidatesForConstructors(
|
||||||
context.scope, context.call, superType, !anyConstructorHasDeclaredTypeParameters, syntheticScopes
|
context.scope, context.call, superType, !anyConstructorHasDeclaredTypeParameters, syntheticScopes
|
||||||
);
|
);
|
||||||
@@ -568,14 +568,14 @@ public class CallResolver {
|
|||||||
@NotNull Call call,
|
@NotNull Call call,
|
||||||
@NotNull TracingStrategy tracing,
|
@NotNull TracingStrategy tracing,
|
||||||
@NotNull ResolutionContext<?> context,
|
@NotNull ResolutionContext<?> context,
|
||||||
@NotNull ResolutionCandidate<FunctionDescriptor> candidate,
|
@NotNull OldResolutionCandidate<FunctionDescriptor> candidate,
|
||||||
@Nullable MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
@Nullable MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
||||||
) {
|
) {
|
||||||
return callResolvePerfCounter.<OverloadResolutionResults<FunctionDescriptor>>time(() -> {
|
return callResolvePerfCounter.<OverloadResolutionResults<FunctionDescriptor>>time(() -> {
|
||||||
BasicCallResolutionContext basicCallResolutionContext =
|
BasicCallResolutionContext basicCallResolutionContext =
|
||||||
BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS, dataFlowInfoForArguments);
|
BasicCallResolutionContext.create(context, call, CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS, dataFlowInfoForArguments);
|
||||||
|
|
||||||
Set<ResolutionCandidate<FunctionDescriptor>> candidates = Collections.singleton(candidate);
|
Set<OldResolutionCandidate<FunctionDescriptor>> candidates = Collections.singleton(candidate);
|
||||||
|
|
||||||
ResolutionTask<FunctionDescriptor> resolutionTask = new ResolutionTask<>(
|
ResolutionTask<FunctionDescriptor> resolutionTask = new ResolutionTask<>(
|
||||||
new NewResolutionOldInference.ResolutionKind.GivenCandidates(), null, candidates
|
new NewResolutionOldInference.ResolutionKind.GivenCandidates(), null, candidates
|
||||||
@@ -737,7 +737,7 @@ public class CallResolver {
|
|||||||
final Name name;
|
final Name name;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
final Collection<ResolutionCandidate<D>> givenCandidates;
|
final Collection<OldResolutionCandidate<D>> givenCandidates;
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
final NewResolutionOldInference.ResolutionKind resolutionKind;
|
final NewResolutionOldInference.ResolutionKind resolutionKind;
|
||||||
@@ -745,7 +745,7 @@ public class CallResolver {
|
|||||||
private ResolutionTask(
|
private ResolutionTask(
|
||||||
@NotNull NewResolutionOldInference.ResolutionKind kind,
|
@NotNull NewResolutionOldInference.ResolutionKind kind,
|
||||||
@Nullable Name name,
|
@Nullable Name name,
|
||||||
@Nullable Collection<ResolutionCandidate<D>> candidates
|
@Nullable Collection<OldResolutionCandidate<D>> candidates
|
||||||
) {
|
) {
|
||||||
this.name = name;
|
this.name = name;
|
||||||
givenCandidates = candidates;
|
givenCandidates = candidates;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ import org.jetbrains.kotlin.resolve.calls.inference.constraintPosition.Constrain
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.getNestedTypeVariables
|
import org.jetbrains.kotlin.resolve.calls.inference.getNestedTypeVariables
|
||||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument
|
import org.jetbrains.kotlin.resolve.calls.model.ResolvedValueArgument
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.isParameterOfAnnotation
|
import org.jetbrains.kotlin.resolve.descriptorUtil.isParameterOfAnnotation
|
||||||
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
import org.jetbrains.kotlin.resolve.scopes.LexicalScope
|
||||||
import org.jetbrains.kotlin.resolve.scopes.SyntheticScopes
|
import org.jetbrains.kotlin.resolve.scopes.SyntheticScopes
|
||||||
@@ -277,7 +277,7 @@ fun createResolutionCandidatesForConstructors(
|
|||||||
typeWithConstructors: KotlinType,
|
typeWithConstructors: KotlinType,
|
||||||
useKnownTypeSubstitutor: Boolean,
|
useKnownTypeSubstitutor: Boolean,
|
||||||
syntheticScopes: SyntheticScopes
|
syntheticScopes: SyntheticScopes
|
||||||
): List<ResolutionCandidate<ConstructorDescriptor>> {
|
): List<OldResolutionCandidate<ConstructorDescriptor>> {
|
||||||
val classWithConstructors = typeWithConstructors.constructor.declarationDescriptor as ClassDescriptor
|
val classWithConstructors = typeWithConstructors.constructor.declarationDescriptor as ClassDescriptor
|
||||||
|
|
||||||
val unwrappedType = typeWithConstructors.unwrap()
|
val unwrappedType = typeWithConstructors.unwrap()
|
||||||
@@ -320,7 +320,7 @@ fun createResolutionCandidatesForConstructors(
|
|||||||
val syntheticConstructors = constructors.flatMap { syntheticScopes.collectSyntheticConstructors(it) }
|
val syntheticConstructors = constructors.flatMap { syntheticScopes.collectSyntheticConstructors(it) }
|
||||||
|
|
||||||
return (constructors + syntheticConstructors).map {
|
return (constructors + syntheticConstructors).map {
|
||||||
ResolutionCandidate.create(call, it, dispatchReceiver, receiverKind, knownSubstitutor)
|
OldResolutionCandidate.create(call, it, dispatchReceiver, receiverKind, knownSubstitutor)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -33,7 +33,7 @@ import org.jetbrains.kotlin.resolve.calls.callResolverUtil.CallResolverUtilKt;
|
|||||||
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystem;
|
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystem;
|
||||||
import org.jetbrains.kotlin.resolve.calls.results.ResolutionStatus;
|
import org.jetbrains.kotlin.resolve.calls.results.ResolutionStatus;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate;
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
|
import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt;
|
||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.*;
|
import org.jetbrains.kotlin.resolve.scopes.receivers.*;
|
||||||
@@ -53,7 +53,7 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(
|
public static <D extends CallableDescriptor> ResolvedCallImpl<D> create(
|
||||||
@NotNull ResolutionCandidate<D> candidate,
|
@NotNull OldResolutionCandidate<D> candidate,
|
||||||
@NotNull DelegatingBindingTrace trace,
|
@NotNull DelegatingBindingTrace trace,
|
||||||
@NotNull TracingStrategy tracing,
|
@NotNull TracingStrategy tracing,
|
||||||
@NotNull MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
@NotNull MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
||||||
@@ -87,7 +87,7 @@ public class ResolvedCallImpl<D extends CallableDescriptor> implements MutableRe
|
|||||||
private Queue<Function0<Unit>> remainingTasks = null;
|
private Queue<Function0<Unit>> remainingTasks = null;
|
||||||
|
|
||||||
private ResolvedCallImpl(
|
private ResolvedCallImpl(
|
||||||
@NotNull ResolutionCandidate<D> candidate,
|
@NotNull OldResolutionCandidate<D> candidate,
|
||||||
@NotNull DelegatingBindingTrace trace,
|
@NotNull DelegatingBindingTrace trace,
|
||||||
@NotNull TracingStrategy tracing,
|
@NotNull TracingStrategy tracing,
|
||||||
@NotNull MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
@NotNull MutableDataFlowInfoForArguments dataFlowInfoForArguments
|
||||||
|
|||||||
+8
-8
@@ -23,14 +23,14 @@ import org.jetbrains.kotlin.psi.Call;
|
|||||||
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue;
|
||||||
import org.jetbrains.kotlin.types.TypeSubstitutor;
|
import org.jetbrains.kotlin.types.TypeSubstitutor;
|
||||||
|
|
||||||
public class ResolutionCandidate<D extends CallableDescriptor> {
|
public class OldResolutionCandidate<D extends CallableDescriptor> {
|
||||||
private final Call call;
|
private final Call call;
|
||||||
private final D candidateDescriptor;
|
private final D candidateDescriptor;
|
||||||
private final TypeSubstitutor knownTypeParametersResultingSubstitutor;
|
private final TypeSubstitutor knownTypeParametersResultingSubstitutor;
|
||||||
private ReceiverValue dispatchReceiver; // receiver object of a method
|
private ReceiverValue dispatchReceiver; // receiver object of a method
|
||||||
private ExplicitReceiverKind explicitReceiverKind;
|
private ExplicitReceiverKind explicitReceiverKind;
|
||||||
|
|
||||||
private ResolutionCandidate(
|
private OldResolutionCandidate(
|
||||||
@NotNull Call call, @NotNull D descriptor, @Nullable ReceiverValue dispatchReceiver,
|
@NotNull Call call, @NotNull D descriptor, @Nullable ReceiverValue dispatchReceiver,
|
||||||
@NotNull ExplicitReceiverKind explicitReceiverKind,
|
@NotNull ExplicitReceiverKind explicitReceiverKind,
|
||||||
@Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
@Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
||||||
@@ -42,25 +42,25 @@ public class ResolutionCandidate<D extends CallableDescriptor> {
|
|||||||
this.knownTypeParametersResultingSubstitutor = knownTypeParametersResultingSubstitutor;
|
this.knownTypeParametersResultingSubstitutor = knownTypeParametersResultingSubstitutor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <D extends CallableDescriptor> ResolutionCandidate<D> create(
|
public static <D extends CallableDescriptor> OldResolutionCandidate<D> create(
|
||||||
@NotNull Call call, @NotNull D descriptor
|
@NotNull Call call, @NotNull D descriptor
|
||||||
) {
|
) {
|
||||||
return new ResolutionCandidate<>(call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, null);
|
return new OldResolutionCandidate<>(call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <D extends CallableDescriptor> ResolutionCandidate<D> create(
|
public static <D extends CallableDescriptor> OldResolutionCandidate<D> create(
|
||||||
@NotNull Call call, @NotNull D descriptor, @Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
@NotNull Call call, @NotNull D descriptor, @Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
||||||
) {
|
) {
|
||||||
return new ResolutionCandidate<>(call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER,
|
return new OldResolutionCandidate<>(call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER,
|
||||||
knownTypeParametersResultingSubstitutor);
|
knownTypeParametersResultingSubstitutor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <D extends CallableDescriptor> ResolutionCandidate<D> create(
|
public static <D extends CallableDescriptor> OldResolutionCandidate<D> create(
|
||||||
@NotNull Call call, @NotNull D descriptor, @Nullable ReceiverValue dispatchReceiver,
|
@NotNull Call call, @NotNull D descriptor, @Nullable ReceiverValue dispatchReceiver,
|
||||||
@NotNull ExplicitReceiverKind explicitReceiverKind,
|
@NotNull ExplicitReceiverKind explicitReceiverKind,
|
||||||
@Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
@Nullable TypeSubstitutor knownTypeParametersResultingSubstitutor
|
||||||
) {
|
) {
|
||||||
return new ResolutionCandidate<>(call, descriptor, dispatchReceiver, explicitReceiverKind, knownTypeParametersResultingSubstitutor);
|
return new OldResolutionCandidate<>(call, descriptor, dispatchReceiver, explicitReceiverKind, knownTypeParametersResultingSubstitutor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDispatchReceiver(@Nullable ReceiverValue dispatchReceiver) {
|
public void setDispatchReceiver(@Nullable ReceiverValue dispatchReceiver) {
|
||||||
+1
-1
@@ -225,7 +225,7 @@ class NewResolutionOldInference(
|
|||||||
fun <D : CallableDescriptor> runResolutionForGivenCandidates(
|
fun <D : CallableDescriptor> runResolutionForGivenCandidates(
|
||||||
basicCallContext: BasicCallResolutionContext,
|
basicCallContext: BasicCallResolutionContext,
|
||||||
tracing: TracingStrategy,
|
tracing: TracingStrategy,
|
||||||
candidates: Collection<ResolutionCandidate<D>>
|
candidates: Collection<OldResolutionCandidate<D>>
|
||||||
): OverloadResolutionResultsImpl<D> {
|
): OverloadResolutionResultsImpl<D> {
|
||||||
val resolvedCandidates = candidates.map { candidate ->
|
val resolvedCandidates = candidates.map { candidate ->
|
||||||
val candidateTrace = TemporaryBindingTrace.create(basicCallContext.trace, "Context for resolve candidate")
|
val candidateTrace = TemporaryBindingTrace.create(basicCallContext.trace, "Context for resolve candidate")
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.resolve.calls.results.*
|
|||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo
|
||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.DynamicCallableDescriptors
|
import org.jetbrains.kotlin.resolve.calls.tasks.DynamicCallableDescriptors
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
|
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.CallMaker
|
import org.jetbrains.kotlin.resolve.calls.util.CallMaker
|
||||||
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
|
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
|
||||||
@@ -121,7 +121,7 @@ class PSICallResolver(
|
|||||||
// actually, `D` is at least FunctionDescriptor, but right now because of CallResolver it isn't possible change upper bound for `D`
|
// actually, `D` is at least FunctionDescriptor, but right now because of CallResolver it isn't possible change upper bound for `D`
|
||||||
fun <D : CallableDescriptor> runResolutionAndInferenceForGivenCandidates(
|
fun <D : CallableDescriptor> runResolutionAndInferenceForGivenCandidates(
|
||||||
context: BasicCallResolutionContext,
|
context: BasicCallResolutionContext,
|
||||||
resolutionCandidates: Collection<ResolutionCandidate<D>>,
|
resolutionCandidates: Collection<OldResolutionCandidate<D>>,
|
||||||
tracingStrategy: TracingStrategy
|
tracingStrategy: TracingStrategy
|
||||||
): OverloadResolutionResults<D> {
|
): OverloadResolutionResults<D> {
|
||||||
val dispatchReceiver = resolutionCandidates.firstNotNullOfOrNull { it.dispatchReceiver }
|
val dispatchReceiver = resolutionCandidates.firstNotNullOfOrNull { it.dispatchReceiver }
|
||||||
|
|||||||
+4
-4
@@ -58,7 +58,7 @@ import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
|
|||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue;
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue;
|
||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability;
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.Nullability;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate;
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tower.NewAbstractResolvedCall;
|
import org.jetbrains.kotlin.resolve.calls.tower.NewAbstractResolvedCall;
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
||||||
@@ -613,8 +613,8 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
) {
|
) {
|
||||||
BindingTrace trace = context.trace;
|
BindingTrace trace = context.trace;
|
||||||
Call call = CallMaker.makeCall(expression, null, null, expression, Collections.emptyList());
|
Call call = CallMaker.makeCall(expression, null, null, expression, Collections.emptyList());
|
||||||
ResolutionCandidate<ReceiverParameterDescriptor> resolutionCandidate =
|
OldResolutionCandidate<ReceiverParameterDescriptor> resolutionCandidate =
|
||||||
ResolutionCandidate.create(
|
OldResolutionCandidate.create(
|
||||||
call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, null);
|
call, descriptor, null, ExplicitReceiverKind.NO_EXPLICIT_RECEIVER, null);
|
||||||
|
|
||||||
ResolvedCallImpl<ReceiverParameterDescriptor> resolvedCall =
|
ResolvedCallImpl<ReceiverParameterDescriptor> resolvedCall =
|
||||||
@@ -1003,7 +1003,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
) {
|
) {
|
||||||
Call call = propertyResolvedCall.getCall();
|
Call call = propertyResolvedCall.getCall();
|
||||||
|
|
||||||
ResolutionCandidate<PropertySetterDescriptor> resolutionCandidate = ResolutionCandidate.create(
|
OldResolutionCandidate<PropertySetterDescriptor> resolutionCandidate = OldResolutionCandidate.create(
|
||||||
call, descriptor, propertyResolvedCall.getDispatchReceiver(), propertyResolvedCall.getExplicitReceiverKind(), null
|
call, descriptor, propertyResolvedCall.getDispatchReceiver(), propertyResolvedCall.getExplicitReceiverKind(), null
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -49,7 +49,7 @@ import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall;
|
|||||||
import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults;
|
import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults;
|
||||||
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
|
import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
import org.jetbrains.kotlin.resolve.calls.tasks.ExplicitReceiverKind;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate;
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate;
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
import org.jetbrains.kotlin.resolve.calls.tasks.TracingStrategy;
|
||||||
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
import org.jetbrains.kotlin.resolve.calls.util.CallMaker;
|
||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.AnnotationsForResolveUtilsKt;
|
import org.jetbrains.kotlin.resolve.descriptorUtil.AnnotationsForResolveUtilsKt;
|
||||||
@@ -162,8 +162,8 @@ public class ControlStructureTypingUtils {
|
|||||||
) {
|
) {
|
||||||
TracingStrategy tracing = createTracingForSpecialConstruction(call, construct.getName(), context);
|
TracingStrategy tracing = createTracingForSpecialConstruction(call, construct.getName(), context);
|
||||||
TypeSubstitutor knownTypeParameterSubstitutor = createKnownTypeParameterSubstitutorForSpecialCall(construct, function, context.expectedType, context.languageVersionSettings);
|
TypeSubstitutor knownTypeParameterSubstitutor = createKnownTypeParameterSubstitutorForSpecialCall(construct, function, context.expectedType, context.languageVersionSettings);
|
||||||
ResolutionCandidate<FunctionDescriptor> resolutionCandidate =
|
OldResolutionCandidate<FunctionDescriptor> resolutionCandidate =
|
||||||
ResolutionCandidate.create(call, function, knownTypeParameterSubstitutor);
|
OldResolutionCandidate.create(call, function, knownTypeParameterSubstitutor);
|
||||||
OverloadResolutionResults<FunctionDescriptor> results = callResolver.resolveCallWithKnownCandidate(
|
OverloadResolutionResults<FunctionDescriptor> results = callResolver.resolveCallWithKnownCandidate(
|
||||||
call, tracing, context, resolutionCandidate, dataFlowInfoForArguments);
|
call, tracing, context, resolutionCandidate, dataFlowInfoForArguments);
|
||||||
assert results.isSingleResult() : "Not single result after resolving one known candidate";
|
assert results.isSingleResult() : "Not single result after resolving one known candidate";
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.name.FqName
|
|||||||
import org.jetbrains.kotlin.name.Name
|
import org.jetbrains.kotlin.name.Name
|
||||||
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
import org.jetbrains.kotlin.renderer.DescriptorRenderer
|
||||||
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
import org.jetbrains.kotlin.resolve.DescriptorUtils
|
||||||
import org.jetbrains.kotlin.resolve.calls.tasks.ResolutionCandidate
|
import org.jetbrains.kotlin.resolve.calls.tasks.OldResolutionCandidate
|
||||||
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
import org.jetbrains.kotlin.resolve.scopes.MemberScope
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.DeserializationContext
|
import org.jetbrains.kotlin.serialization.deserialization.DeserializationContext
|
||||||
import org.jetbrains.kotlin.serialization.deserialization.TypeDeserializer
|
import org.jetbrains.kotlin.serialization.deserialization.TypeDeserializer
|
||||||
@@ -185,7 +185,7 @@ class LazyOperationsLog(
|
|||||||
}
|
}
|
||||||
}.appendQuoted()
|
}.appendQuoted()
|
||||||
}
|
}
|
||||||
o is ResolutionCandidate<*> -> DescriptorRenderer.COMPACT.render(o.descriptor).appendQuoted()
|
o is OldResolutionCandidate<*> -> DescriptorRenderer.COMPACT.render(o.descriptor).appendQuoted()
|
||||||
}
|
}
|
||||||
return sb.toString()
|
return sb.toString()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user