[FE 1.0] Check for type mismatch for empty when statements

^KT-47922 Fixed
This commit is contained in:
Dmitriy Novozhilov
2021-08-04 13:16:04 +03:00
committed by TeamCityServer
parent 60195114c1
commit 8578f0beea
24 changed files with 487 additions and 22 deletions
@@ -305,8 +305,11 @@ public class DataFlowAnalyzer {
}
if (expression instanceof KtWhenExpression) {
// No need in additional check because type mismatch is already reported for entries
return expressionType;
KtWhenExpression whenExpression = (KtWhenExpression) expression;
if (!whenExpression.getEntries().isEmpty()) {
// No need in additional check because type mismatch is already reported for entries
return expressionType;
}
}
SmartCastResult castResult = checkPossibleCast(expressionType, expression, c);