[NI] Fix IDE-tests where integer types were used in unresolved calls

For example, test like CallExpression#testCallWithJavaClassReceiver

 #KT-31060 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2019-04-16 15:31:24 +03:00
parent 705a8a2234
commit e6e0b83184
7 changed files with 18 additions and 9 deletions
@@ -125,8 +125,10 @@ class KotlinToResolvedCallTransformer(
doubleColonExpressionResolver, builtIns, deprecationResolver, moduleDescriptor, dataFlowValueFactory
)
for (subKtPrimitive in candidate.subResolvedAtoms) {
ktPrimitiveCompleter.completeAll(subKtPrimitive)
if (!ErrorUtils.isError(candidate.candidateDescriptor)) {
for (subKtPrimitive in candidate.subResolvedAtoms) {
ktPrimitiveCompleter.completeAll(subKtPrimitive)
}
}
val resolvedCall = ktPrimitiveCompleter.completeResolvedCall(candidate, baseResolvedCall.diagnostics) as ResolvedCall<D>
@@ -202,7 +202,7 @@ class PSICallResolver(
val trace = context.trace
handleErrorResolutionResult<D>(trace, result, tracingStrategy)?.let { errorResult ->
handleErrorResolutionResult<D>(context, trace, result, tracingStrategy)?.let { errorResult ->
context.inferenceSession.addErrorCallInfo(PSIErrorCallInfo(result, errorResult))
return errorResult
}
@@ -217,6 +217,7 @@ class PSICallResolver(
}
private fun <D : CallableDescriptor> handleErrorResolutionResult(
context: BasicCallResolutionContext,
trace: BindingTrace,
result: CallResolutionResult,
tracingStrategy: TracingStrategy
@@ -224,6 +225,8 @@ class PSICallResolver(
val diagnostics = result.diagnostics
diagnostics.firstIsInstanceOrNull<NoneCandidatesCallDiagnostic>()?.let {
kotlinToResolvedCallTransformer.transformAndReport<D>(result, context, tracingStrategy)
tracingStrategy.unresolvedReference(trace)
return OverloadResolutionResultsImpl.nameNotFound()
}
@@ -84,6 +84,12 @@ class ResolvedAtomCompleter(
diagnostics
)
val lastCall = if (resolvedCall is VariableAsFunctionResolvedCall) resolvedCall.functionCall else resolvedCall
if (ErrorUtils.isError(resolvedCall.candidateDescriptor)) {
kotlinToResolvedCallTransformer.runArgumentsChecks(topLevelCallContext, topLevelTrace, lastCall as NewResolvedCallImpl<*>)
return resolvedCall
}
val resolutionContextForPartialCall =
topLevelCallContext.trace[BindingContext.PARTIAL_CALL_RESOLUTION_CONTEXT, resolvedCallAtom.atom.psiKotlinCall.psiCall]
@@ -98,8 +104,6 @@ class ResolvedAtomCompleter(
kotlinToResolvedCallTransformer.bindAndReport(topLevelCallContext, topLevelTrace, resolvedCall, diagnostics)
val lastCall = if (resolvedCall is VariableAsFunctionResolvedCall) resolvedCall.functionCall else resolvedCall
kotlinToResolvedCallTransformer.runArgumentsChecks(topLevelCallContext, topLevelTrace, lastCall as NewResolvedCallImpl<*>)
kotlinToResolvedCallTransformer.runCallCheckers(resolvedCall, callCheckerContext)
kotlinToResolvedCallTransformer.runAdditionalReceiversCheckers(resolvedCall, topLevelCallContext)