[NI] Fix diagnostic reporting for missing type parameter info

#KT-31975 fixed
This commit is contained in:
Ilya Chernikov
2019-11-22 17:18:47 +01:00
parent 7dd9ed7e38
commit b3c5362003
7 changed files with 72 additions and 4 deletions
@@ -357,10 +357,13 @@ class DiagnosticReporterByTrackingStrategy(
}
NotEnoughInformationForTypeParameter::class.java -> {
if (allDiagnostics.any {it is ConstrainingTypeIsError || it is NewConstraintError || it is WrongCountOfTypeArguments})
return
val error = diagnostic as NotEnoughInformationForTypeParameter
if (allDiagnostics.any {
(it is ConstrainingTypeIsError && it.typeVariable == error.typeVariable)
|| it is NewConstraintError || it is WrongCountOfTypeArguments
}
) return
val call = error.resolvedAtom.atom?.safeAs<PSIKotlinCall>()?.psiCall ?: call
val expression = call.calleeExpression ?: return
val typeVariableName = when (val typeVariable = error.typeVariable) {