[NI] Don't loose diagnostic after type variable fixation
#KT-24488 Fixed
This commit is contained in:
+18
@@ -317,6 +317,24 @@ class DiagnosticReporterByTrackingStrategy(
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
(position as? FixVariableConstraintPosition)?.let {
|
||||
val morePreciseDiagnosticExists = allDiagnostics.any { other ->
|
||||
other is NewConstraintError && other.position.from !is FixVariableConstraintPosition
|
||||
}
|
||||
if (morePreciseDiagnosticExists) return
|
||||
|
||||
val call = it.resolvedAtom?.atom?.safeAs<PSIKotlinCall>()?.psiCall ?: call
|
||||
val expression = call.calleeExpression ?: return
|
||||
|
||||
trace.reportDiagnosticOnce(
|
||||
TYPE_MISMATCH.on(
|
||||
expression,
|
||||
constraintError.upperKotlinType,
|
||||
constraintError.lowerKotlinType
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
CapturedTypeFromSubtyping::class.java -> {
|
||||
|
||||
Reference in New Issue
Block a user