rename ResolveMode to ResolveArgumentsMode
This commit is contained in:
+4
-4
@@ -45,8 +45,8 @@ import java.util.Set;
|
||||
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContextUtils.recordExpressionType;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.*;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode.SKIP_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.SKIP_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
|
||||
public class ArgumentTypeResolver {
|
||||
@@ -86,7 +86,7 @@ public class ArgumentTypeResolver {
|
||||
checkTypesWithNoCallee(context, SKIP_FUNCTION_ARGUMENTS);
|
||||
}
|
||||
|
||||
public void checkTypesWithNoCallee(@NotNull CallResolutionContext context, @NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||
public void checkTypesWithNoCallee(@NotNull CallResolutionContext context, @NotNull ResolveArgumentsMode resolveFunctionArgumentBodies) {
|
||||
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
||||
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
||||
if (argumentExpression != null && !(argumentExpression instanceof JetFunctionLiteralExpression)) {
|
||||
@@ -158,7 +158,7 @@ public class ArgumentTypeResolver {
|
||||
public TypeInfoForCall getArgumentTypeInfo(
|
||||
@Nullable JetExpression expression,
|
||||
@NotNull CallResolutionContext context,
|
||||
@NotNull ResolveMode resolveFunctionArgumentBodies
|
||||
@NotNull ResolveArgumentsMode resolveFunctionArgumentBodies
|
||||
) {
|
||||
if (expression == null) {
|
||||
return TypeInfoForCall.create(null, context.dataFlowInfo);
|
||||
|
||||
@@ -52,7 +52,7 @@ import java.util.*;
|
||||
import static org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor.NO_RECEIVER_PARAMETER;
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.*;
|
||||
import static org.jetbrains.jet.lang.resolve.BindingContext.*;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue.NO_RECEIVER;
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
|
||||
|
||||
@@ -18,7 +18,6 @@ package org.jetbrains.jet.lang.resolve.calls;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.CallableDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor;
|
||||
import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor;
|
||||
@@ -35,15 +34,13 @@ import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
|
||||
public class CallResolverUtil {
|
||||
|
||||
public static final JetType DONT_CARE = ErrorUtils.createErrorTypeWithCustomDebugName("DONT_CARE");
|
||||
public static final JetType CANT_INFER = ErrorUtils.createErrorTypeWithCustomDebugName("CANT_INFER");
|
||||
public static final JetType PLACEHOLDER_FUNCTION_TYPE = ErrorUtils.createErrorTypeWithCustomDebugName("PLACEHOLDER_FUNCTION_TYPE");
|
||||
|
||||
public enum ResolveMode {
|
||||
public static enum ResolveArgumentsMode {
|
||||
RESOLVE_FUNCTION_ARGUMENTS,
|
||||
SKIP_FUNCTION_ARGUMENTS
|
||||
}
|
||||
|
||||
@@ -51,9 +51,8 @@ import static org.jetbrains.jet.lang.diagnostics.Errors.PROJECTION_ON_NON_CLASS_
|
||||
import static org.jetbrains.jet.lang.diagnostics.Errors.SUPER_IS_NOT_AN_EXPRESSION;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.DONT_CARE;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.PLACEHOLDER_FUNCTION_TYPE;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveMode.SKIP_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.SKIP_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus.*;
|
||||
import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
|
||||
@@ -400,7 +399,7 @@ public class CandidateResolver {
|
||||
@NotNull ConstraintSystem constraintSystem,
|
||||
@NotNull CallResolutionContext<C> context,
|
||||
@Nullable boolean[] isErrorType,
|
||||
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||
@NotNull CallResolverUtil.ResolveArgumentsMode resolveFunctionArgumentBodies) {
|
||||
|
||||
JetType effectiveExpectedType = getEffectiveExpectedType(valueParameterDescriptor, valueArgument);
|
||||
JetExpression argumentExpression = valueArgument.getArgumentExpression();
|
||||
@@ -421,7 +420,7 @@ public class CandidateResolver {
|
||||
|
||||
private <D extends CallableDescriptor> ValueArgumentsCheckingResult checkAllValueArguments(
|
||||
@NotNull CallCandidateResolutionContext<D> context,
|
||||
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||
@NotNull CallResolverUtil.ResolveArgumentsMode resolveFunctionArgumentBodies) {
|
||||
ValueArgumentsCheckingResult checkingResult = checkValueArgumentTypes(context, context.candidateCall,
|
||||
context.candidateCall.getTrace(), resolveFunctionArgumentBodies);
|
||||
ResolutionStatus resultStatus = checkingResult.status;
|
||||
@@ -446,7 +445,7 @@ public class CandidateResolver {
|
||||
@NotNull CallResolutionContext<C> context,
|
||||
@NotNull ResolvedCallImpl<D> candidateCall,
|
||||
@NotNull BindingTrace trace,
|
||||
@NotNull ResolveMode resolveFunctionArgumentBodies) {
|
||||
@NotNull CallResolverUtil.ResolveArgumentsMode resolveFunctionArgumentBodies) {
|
||||
ResolutionStatus resultStatus = SUCCESS;
|
||||
List<JetType> argumentTypes = Lists.newArrayList();
|
||||
for (Map.Entry<ValueParameterDescriptor, ResolvedValueArgument> entry : candidateCall.getValueArguments().entrySet()) {
|
||||
|
||||
Reference in New Issue
Block a user