Create from usage: Fixed expected type for if-expression.
This commit is contained in:
+2
-1
@@ -65,7 +65,8 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
|
||||
@NotNull
|
||||
private DataFlowInfo checkCondition(@NotNull JetScope scope, @Nullable JetExpression condition, ExpressionTypingContext context) {
|
||||
if (condition != null) {
|
||||
JetTypeInfo typeInfo = facade.getTypeInfo(condition, context.replaceScope(scope));
|
||||
JetTypeInfo typeInfo = facade.getTypeInfo(condition, context.replaceScope(scope)
|
||||
.replaceExpectedType(KotlinBuiltIns.getInstance().getBooleanType()));
|
||||
JetType conditionType = typeInfo.getType();
|
||||
|
||||
if (conditionType != null && !isBoolean(conditionType)) {
|
||||
|
||||
Reference in New Issue
Block a user