Minor. Drop unused method
This commit is contained in:
@@ -59,7 +59,6 @@ import java.util.List;
|
||||
|
||||
import static org.jetbrains.kotlin.psi.KtPsiUtil.getLastElementDeparenthesized;
|
||||
import static org.jetbrains.kotlin.resolve.BindingContextUtils.getRecordedTypeInfo;
|
||||
import static org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode.SHAPE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.kotlin.resolve.calls.context.ContextDependency.DEPENDENT;
|
||||
import static org.jetbrains.kotlin.resolve.calls.context.ContextDependency.INDEPENDENT;
|
||||
@@ -109,13 +108,8 @@ public class ArgumentTypeResolver {
|
||||
return KotlinTypeChecker.DEFAULT.isSubtypeOf(actualType, expectedType);
|
||||
}
|
||||
|
||||
public void checkTypesWithNoCallee(@NotNull CallResolutionContext<?> context) {
|
||||
checkTypesWithNoCallee(context, SHAPE_FUNCTION_ARGUMENTS);
|
||||
}
|
||||
|
||||
public void checkTypesWithNoCallee(
|
||||
@NotNull CallResolutionContext<?> context,
|
||||
@NotNull ResolveArgumentsMode resolveFunctionArgumentBodies
|
||||
@NotNull CallResolutionContext<?> context
|
||||
) {
|
||||
if (context.checkArguments != CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS) return;
|
||||
|
||||
@@ -126,9 +120,7 @@ public class ArgumentTypeResolver {
|
||||
}
|
||||
}
|
||||
|
||||
if (resolveFunctionArgumentBodies == RESOLVE_FUNCTION_ARGUMENTS) {
|
||||
checkTypesForFunctionArgumentsWithNoCallee(context);
|
||||
}
|
||||
checkTypesForFunctionArgumentsWithNoCallee(context);
|
||||
|
||||
for (KtTypeProjection typeProjection : context.call.getTypeArguments()) {
|
||||
KtTypeReference typeReference = typeProjection.getTypeReference();
|
||||
@@ -141,7 +133,7 @@ public class ArgumentTypeResolver {
|
||||
}
|
||||
}
|
||||
|
||||
public void checkTypesForFunctionArgumentsWithNoCallee(@NotNull CallResolutionContext<?> context) {
|
||||
private void checkTypesForFunctionArgumentsWithNoCallee(@NotNull CallResolutionContext<?> context) {
|
||||
if (context.checkArguments != CheckArgumentTypesMode.CHECK_VALUE_ARGUMENTS) return;
|
||||
|
||||
for (ValueArgument valueArgument : context.call.getValueArguments()) {
|
||||
@@ -175,15 +167,6 @@ public class ArgumentTypeResolver {
|
||||
return isFunctionLiteralArgument(expression, context) || isCallableReferenceArgument(expression, context);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static KtFunction getFunctionLiteralArgument(
|
||||
@NotNull KtExpression expression, @NotNull ResolutionContext context
|
||||
) {
|
||||
assert isFunctionLiteralArgument(expression, context);
|
||||
//noinspection ConstantConditions
|
||||
return getFunctionLiteralArgumentIfAny(expression, context);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static KtFunction getFunctionLiteralArgumentIfAny(
|
||||
@NotNull KtExpression expression, @NotNull ResolutionContext context
|
||||
|
||||
@@ -62,7 +62,6 @@ import javax.inject.Inject;
|
||||
import java.util.*;
|
||||
|
||||
import static org.jetbrains.kotlin.diagnostics.Errors.*;
|
||||
import static org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS;
|
||||
import static org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults.Code.INCOMPLETE_TYPE_INFERENCE;
|
||||
import static org.jetbrains.kotlin.types.TypeUtils.NO_EXPECTED_TYPE;
|
||||
|
||||
@@ -621,7 +620,7 @@ public class CallResolver {
|
||||
if (CallResolverUtilKt.isInvokeCallOnVariable(context.call)) return;
|
||||
if (!results.isSingleResult()) {
|
||||
if (results.getResultCode() == INCOMPLETE_TYPE_INFERENCE) {
|
||||
argumentTypeResolver.checkTypesWithNoCallee(context, RESOLVE_FUNCTION_ARGUMENTS);
|
||||
argumentTypeResolver.checkTypesWithNoCallee(context);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -648,7 +647,7 @@ public class CallResolver {
|
||||
}
|
||||
|
||||
private <D extends CallableDescriptor> OverloadResolutionResultsImpl<D> checkArgumentTypesAndFail(BasicCallResolutionContext context) {
|
||||
argumentTypeResolver.checkTypesWithNoCallee(context, ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS);
|
||||
argumentTypeResolver.checkTypesWithNoCallee(context);
|
||||
return OverloadResolutionResultsImpl.nameNotFound();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user