use of org.jetbrains.kotlin.resolve.calls.context.CallResolutionContext in project kotlin by JetBrains.
the class ArgumentTypeResolver method getArgumentTypeInfo.
@NotNull
public KotlinTypeInfo getArgumentTypeInfo(@Nullable KtExpression expression, @NotNull CallResolutionContext<?> context, @NotNull ResolveArgumentsMode resolveArgumentsMode) {
if (expression == null) {
return TypeInfoFactoryKt.noTypeInfo(context);
}
KtFunction functionLiteralArgument = getFunctionLiteralArgumentIfAny(expression, context);
if (functionLiteralArgument != null) {
return getFunctionLiteralTypeInfo(expression, functionLiteralArgument, context, resolveArgumentsMode);
}
KtCallableReferenceExpression callableReferenceExpression = getCallableReferenceExpressionIfAny(expression, context);
if (callableReferenceExpression != null) {
return getCallableReferenceTypeInfo(expression, callableReferenceExpression, context, resolveArgumentsMode);
}
KotlinTypeInfo recordedTypeInfo = getRecordedTypeInfo(expression, context.trace.getBindingContext());
if (recordedTypeInfo != null) {
return recordedTypeInfo;
}
ResolutionContext newContext = context.replaceExpectedType(NO_EXPECTED_TYPE).replaceContextDependency(DEPENDENT);
return expressionTypingServices.getTypeInfo(expression, newContext);
}
Aggregations