Report error about invalid if as expression on the if keyword

#KT-14633 Fixed
This commit is contained in:
Mikhail Zarechenskiy
2017-06-21 18:51:05 +03:00
parent e40c8fff05
commit 9847278699
16 changed files with 111 additions and 112 deletions
@@ -717,7 +717,7 @@ class ControlFlowInformationProvider private constructor(
val elseExpression = element.`else`
if (thenExpression == null || elseExpression == null) {
trace.report(INVALID_IF_AS_EXPRESSION.on(element))
trace.report(INVALID_IF_AS_EXPRESSION.on(element.ifKeyword))
}
else {
checkImplicitCastOnConditionalExpression(element)
@@ -776,7 +776,7 @@ public interface Errors {
DiagnosticFactory0<KtElement> SENSELESS_NULL_IN_WHEN = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<KtIfExpression> INVALID_IF_AS_EXPRESSION = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> INVALID_IF_AS_EXPRESSION = DiagnosticFactory0.create(ERROR);
// Nullability