Fix bug in chained boolean typecheck (#490)

This commit is contained in:
JT
2021-12-14 16:19:16 +11:00
committed by GitHub
parent 673fe2b56a
commit 04a9c8f3fd
3 changed files with 6 additions and 2 deletions

View File

@ -3018,7 +3018,6 @@ pub fn parse_math_expression(
ty: result_ty,
custom_completion: None,
});
// }
}
expr_stack.push(op);
expr_stack.push(rhs);

View File

@ -131,7 +131,7 @@ pub fn math_result_type(
}
},
Operator::And | Operator::Or => match (&lhs.ty, &rhs.ty) {
(Type::Bool, Type::Bool) => (Type::Int, None),
(Type::Bool, Type::Bool) => (Type::Bool, None),
(Type::Unknown, _) => (Type::Unknown, None),
(_, Type::Unknown) => (Type::Unknown, None),