Report error about invalid if as expression on the if keyword
#KT-14633 Fixed
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user