[NI] Don't forget to deparenthesize expression before type checking
This commit is contained in:
+3
-2
@@ -159,8 +159,9 @@ class DiagnosticReporterByTrackingStrategy(
|
|||||||
?: (position as? ReceiverConstraintPosition)?.argument
|
?: (position as? ReceiverConstraintPosition)?.argument
|
||||||
argument?.let {
|
argument?.let {
|
||||||
val expression = it.psiExpression ?: return
|
val expression = it.psiExpression ?: return
|
||||||
if (reportConstantTypeMismatch(constraintError, expression)) return
|
val deparenthesized = KtPsiUtil.safeDeparenthesize(expression)
|
||||||
trace.report(Errors.TYPE_MISMATCH.on(expression, constraintError.upperType, constraintError.lowerType))
|
if (reportConstantTypeMismatch(constraintError, deparenthesized)) return
|
||||||
|
trace.report(Errors.TYPE_MISMATCH.on(deparenthesized, constraintError.upperType, constraintError.lowerType))
|
||||||
}
|
}
|
||||||
(position as? ExplicitTypeParameterConstraintPosition)?.let {
|
(position as? ExplicitTypeParameterConstraintPosition)?.let {
|
||||||
val typeArgumentReference = (it.typeArgument as SimpleTypeArgumentImpl).typeReference
|
val typeArgumentReference = (it.typeArgument as SimpleTypeArgumentImpl).typeReference
|
||||||
|
|||||||
Reference in New Issue
Block a user