rename ResolutionContext to CallResolutionContext
introduced ResolutionContext (without call)
This commit is contained in:
+5
-5
@@ -82,11 +82,11 @@ public class ArgumentTypeResolver {
|
|||||||
return KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(supertype) || ErrorUtils.isErrorType(supertype);
|
return KotlinBuiltIns.getInstance().isFunctionOrExtensionFunctionType(supertype) || ErrorUtils.isErrorType(supertype);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkTypesWithNoCallee(@NotNull ResolutionContext context) {
|
public void checkTypesWithNoCallee(@NotNull CallResolutionContext context) {
|
||||||
checkTypesWithNoCallee(context, SKIP_FUNCTION_ARGUMENTS);
|
checkTypesWithNoCallee(context, SKIP_FUNCTION_ARGUMENTS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkTypesWithNoCallee(@NotNull ResolutionContext context, @NotNull ResolveMode resolveFunctionArgumentBodies) {
|
public void checkTypesWithNoCallee(@NotNull CallResolutionContext context, @NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||||
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
||||||
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
||||||
if (argumentExpression != null && !(argumentExpression instanceof JetFunctionLiteralExpression)) {
|
if (argumentExpression != null && !(argumentExpression instanceof JetFunctionLiteralExpression)) {
|
||||||
@@ -109,7 +109,7 @@ public class ArgumentTypeResolver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkTypesForFunctionArgumentsWithNoCallee(@NotNull ResolutionContext context) {
|
public void checkTypesForFunctionArgumentsWithNoCallee(@NotNull CallResolutionContext context) {
|
||||||
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
||||||
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
||||||
if (argumentExpression != null && (argumentExpression instanceof JetFunctionLiteralExpression)) {
|
if (argumentExpression != null && (argumentExpression instanceof JetFunctionLiteralExpression)) {
|
||||||
@@ -122,7 +122,7 @@ public class ArgumentTypeResolver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void checkUnmappedArgumentTypes(ResolutionContext context, Set<ValueArgument> unmappedArguments) {
|
public void checkUnmappedArgumentTypes(CallResolutionContext context, Set<ValueArgument> unmappedArguments) {
|
||||||
for (ValueArgument valueArgument : unmappedArguments) {
|
for (ValueArgument valueArgument : unmappedArguments) {
|
||||||
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
||||||
if (argumentExpression != null) {
|
if (argumentExpression != null) {
|
||||||
@@ -131,7 +131,7 @@ public class ArgumentTypeResolver {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public <D extends CallableDescriptor> void checkTypesForFunctionArguments(ResolutionContext context, ResolvedCallImpl<D> resolvedCall) {
|
public <D extends CallableDescriptor> void checkTypesForFunctionArguments(CallResolutionContext context, ResolvedCallImpl<D> resolvedCall) {
|
||||||
Map<ValueParameterDescriptor, ResolvedValueArgument> arguments = resolvedCall.getValueArguments();
|
Map<ValueParameterDescriptor, ResolvedValueArgument> arguments = resolvedCall.getValueArguments();
|
||||||
for (Map.Entry<ValueParameterDescriptor, ResolvedValueArgument> entry : arguments.entrySet()) {
|
for (Map.Entry<ValueParameterDescriptor, ResolvedValueArgument> entry : arguments.entrySet()) {
|
||||||
ValueParameterDescriptor valueParameterDescriptor = entry.getKey();
|
ValueParameterDescriptor valueParameterDescriptor = entry.getKey();
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
|||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
|
|
||||||
public class BasicResolutionContext extends ResolutionContext {
|
public class BasicResolutionContext extends CallResolutionContext {
|
||||||
@NotNull
|
@NotNull
|
||||||
public static BasicResolutionContext create(
|
public static BasicResolutionContext create(
|
||||||
@NotNull BindingTrace trace,
|
@NotNull BindingTrace trace,
|
||||||
|
|||||||
+1
-1
@@ -25,7 +25,7 @@ import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionTask;
|
|||||||
import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy;
|
import org.jetbrains.jet.lang.resolve.calls.tasks.TracingStrategy;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue;
|
||||||
|
|
||||||
public final class CallCandidateResolutionContext<D extends CallableDescriptor, F extends D> extends ResolutionContext {
|
public final class CallCandidateResolutionContext<D extends CallableDescriptor, F extends D> extends CallResolutionContext {
|
||||||
/*package*/ final ResolvedCallImpl<D> candidateCall;
|
/*package*/ final ResolvedCallImpl<D> candidateCall;
|
||||||
/*package*/ final TracingStrategy tracing;
|
/*package*/ final TracingStrategy tracing;
|
||||||
/*package*/ ReceiverValue receiverForVariableAsFunctionSecondCall = ReceiverValue.NO_RECEIVER;
|
/*package*/ ReceiverValue receiverForVariableAsFunctionSecondCall = ReceiverValue.NO_RECEIVER;
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
/*
|
||||||
|
* Copyright 2010-2012 JetBrains s.r.o.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.jetbrains.jet.lang.resolve.calls;
|
||||||
|
|
||||||
|
import org.jetbrains.jet.lang.psi.Call;
|
||||||
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
|
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||||
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
|
|
||||||
|
public abstract class CallResolutionContext extends ResolutionContext {
|
||||||
|
public final Call call;
|
||||||
|
|
||||||
|
protected CallResolutionContext(
|
||||||
|
BindingTrace trace,
|
||||||
|
JetScope scope,
|
||||||
|
Call call,
|
||||||
|
JetType expectedType,
|
||||||
|
DataFlowInfo dataFlowInfo,
|
||||||
|
boolean namespacesAllowed
|
||||||
|
) {
|
||||||
|
super(trace, scope, expectedType, dataFlowInfo, namespacesAllowed);
|
||||||
|
this.call = call;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BasicResolutionContext toBasic() {
|
||||||
|
return BasicResolutionContext.create(trace, scope, call, expectedType, dataFlowInfo, namespacesAllowed);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -44,7 +44,7 @@ public class CallResolverUtil {
|
|||||||
|
|
||||||
private CallResolverUtil() {}
|
private CallResolverUtil() {}
|
||||||
|
|
||||||
public static <D extends CallableDescriptor> ResolvedCallImpl<D> copy(@NotNull ResolvedCallImpl<D> call, @NotNull ResolutionContext context) {
|
public static <D extends CallableDescriptor> ResolvedCallImpl<D> copy(@NotNull ResolvedCallImpl<D> call, @NotNull CallResolutionContext context) {
|
||||||
ResolutionCandidate<D> candidate = ResolutionCandidate.create(call.getCandidateDescriptor(), call.getThisObject(),
|
ResolutionCandidate<D> candidate = ResolutionCandidate.create(call.getCandidateDescriptor(), call.getThisObject(),
|
||||||
call.getReceiverArgument(), call.getExplicitReceiverKind(),
|
call.getReceiverArgument(), call.getExplicitReceiverKind(),
|
||||||
call.isSafeCall());
|
call.isSafeCall());
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ public class CandidateResolver {
|
|||||||
@NotNull ValueParameterDescriptor valueParameterDescriptor,
|
@NotNull ValueParameterDescriptor valueParameterDescriptor,
|
||||||
@NotNull TypeSubstitutor substitutor,
|
@NotNull TypeSubstitutor substitutor,
|
||||||
@NotNull ConstraintSystem constraintSystem,
|
@NotNull ConstraintSystem constraintSystem,
|
||||||
@NotNull ResolutionContext context,
|
@NotNull CallResolutionContext context,
|
||||||
@Nullable boolean[] isErrorType,
|
@Nullable boolean[] isErrorType,
|
||||||
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||||
|
|
||||||
@@ -395,7 +395,7 @@ public class CandidateResolver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private <D extends CallableDescriptor> ValueArgumentsCheckingResult checkValueArgumentTypes(
|
private <D extends CallableDescriptor> ValueArgumentsCheckingResult checkValueArgumentTypes(
|
||||||
@NotNull ResolutionContext context,
|
@NotNull CallResolutionContext context,
|
||||||
@NotNull ResolvedCallImpl<D> candidateCall,
|
@NotNull ResolvedCallImpl<D> candidateCall,
|
||||||
@NotNull BindingTrace trace,
|
@NotNull BindingTrace trace,
|
||||||
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||||
|
|||||||
@@ -16,30 +16,29 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.calls;
|
package org.jetbrains.jet.lang.resolve.calls;
|
||||||
|
|
||||||
import org.jetbrains.jet.lang.psi.Call;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
import org.jetbrains.jet.lang.types.JetType;
|
import org.jetbrains.jet.lang.types.JetType;
|
||||||
|
|
||||||
public abstract class ResolutionContext {
|
public class ResolutionContext {
|
||||||
public final BindingTrace trace;
|
public final BindingTrace trace;
|
||||||
public final JetScope scope;
|
public final JetScope scope;
|
||||||
public final Call call;
|
|
||||||
public final JetType expectedType;
|
public final JetType expectedType;
|
||||||
public final DataFlowInfo dataFlowInfo;
|
public final DataFlowInfo dataFlowInfo;
|
||||||
public final boolean namespacesAllowed;
|
public final boolean namespacesAllowed;
|
||||||
|
|
||||||
protected ResolutionContext(BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo, boolean namespacesAllowed) {
|
protected ResolutionContext(
|
||||||
|
BindingTrace trace,
|
||||||
|
JetScope scope,
|
||||||
|
JetType expectedType,
|
||||||
|
DataFlowInfo dataFlowInfo,
|
||||||
|
boolean namespacesAllowed
|
||||||
|
) {
|
||||||
this.trace = trace;
|
this.trace = trace;
|
||||||
this.scope = scope;
|
this.scope = scope;
|
||||||
this.call = call;
|
|
||||||
this.expectedType = expectedType;
|
this.expectedType = expectedType;
|
||||||
this.dataFlowInfo = dataFlowInfo;
|
this.dataFlowInfo = dataFlowInfo;
|
||||||
this.namespacesAllowed = namespacesAllowed;
|
this.namespacesAllowed = namespacesAllowed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public BasicResolutionContext toBasic() {
|
|
||||||
return BasicResolutionContext.create(trace, scope, call, expectedType, dataFlowInfo, namespacesAllowed);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -25,7 +25,7 @@ import org.jetbrains.jet.lang.diagnostics.Errors;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.BasicResolutionContext;
|
import org.jetbrains.jet.lang.resolve.calls.BasicResolutionContext;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.ResolutionContext;
|
import org.jetbrains.jet.lang.resolve.calls.CallResolutionContext;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
|
import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.inference.InferenceErrorData;
|
import org.jetbrains.jet.lang.resolve.calls.inference.InferenceErrorData;
|
||||||
@@ -52,7 +52,7 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
|||||||
/**
|
/**
|
||||||
* Stores candidates for call resolution.
|
* Stores candidates for call resolution.
|
||||||
*/
|
*/
|
||||||
public class ResolutionTask<D extends CallableDescriptor, F extends D> extends ResolutionContext {
|
public class ResolutionTask<D extends CallableDescriptor, F extends D> extends CallResolutionContext {
|
||||||
private final Collection<ResolutionCandidate<D>> candidates;
|
private final Collection<ResolutionCandidate<D>> candidates;
|
||||||
private final Set<ResolvedCallWithTrace<F>> resolvedCalls = Sets.newLinkedHashSet();
|
private final Set<ResolvedCallWithTrace<F>> resolvedCalls = Sets.newLinkedHashSet();
|
||||||
public final JetReferenceExpression reference;
|
public final JetReferenceExpression reference;
|
||||||
|
|||||||
Reference in New Issue
Block a user