Report more specific diagnostic for variable + invoke calls
Do not report same set of diagnostics for variable call if actual error was happened with a function candidate. Here the candidate is invoke function on DeepRecursiveFunction ^KT-40991 Fixed ^KT-41491 Fixed ^KT-40926 In Progress
This commit is contained in:
+4
-2
@@ -205,10 +205,12 @@ class KotlinToResolvedCallTransformer(
|
||||
): ResolvedCall<D> {
|
||||
val psiKotlinCall = completedCallAtom.atom.psiKotlinCall
|
||||
return if (psiKotlinCall is PSIKotlinCallForInvoke) {
|
||||
val diagnosticsForVariableCall = if (completedCallAtom.candidateDescriptor is FunctionDescriptor) emptyList() else diagnostics
|
||||
val diagnosticsForFunctionCall = if (completedCallAtom.candidateDescriptor is FunctionDescriptor) diagnostics else emptyList()
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
NewVariableAsFunctionResolvedCallImpl(
|
||||
createOrGet(psiKotlinCall.variableCall.resolvedCall, trace, resultSubstitutor, diagnostics),
|
||||
createOrGet(completedCallAtom, trace, resultSubstitutor, diagnostics),
|
||||
createOrGet(psiKotlinCall.variableCall.resolvedCall, trace, resultSubstitutor, diagnosticsForVariableCall),
|
||||
createOrGet(completedCallAtom, trace, resultSubstitutor, diagnosticsForFunctionCall),
|
||||
) as ResolvedCall<D>
|
||||
} else {
|
||||
createOrGet(completedCallAtom, trace, resultSubstitutor, diagnostics)
|
||||
|
||||
Reference in New Issue
Block a user