[NI] Report "not enough information" on callable references in lambdas

^KT-34314 Fixed
This commit is contained in:
Pavel Kirpichenkov
2020-01-09 11:50:43 +03:00
parent 4e4e57f60a
commit 96c1b96f3a
10 changed files with 71 additions and 2 deletions
@@ -373,8 +373,12 @@ class DiagnosticReporterByTrackingStrategy(
}
) return
val call = error.resolvedAtom.atom?.safeAs<PSIKotlinCall>()?.psiCall ?: call
val expression = call.calleeExpression ?: return
val expression = when (val atom = error.resolvedAtom.atom) {
is PSIKotlinCall -> atom.psiCall.calleeExpression
is PSIKotlinCallArgument -> atom.valueArgument.getArgumentExpression()
else -> call.calleeExpression
} ?: return
val typeVariableName = when (val typeVariable = error.typeVariable) {
is TypeVariableFromCallableDescriptor -> typeVariable.originalTypeParameter.name.asString()
is TypeVariableForLambdaReturnType -> "return type of lambda"