mirror of
https://github.com/nushell/nushell.git
synced 2024-12-22 23:23:12 +01:00
Fix bug in chained boolean typecheck (#490)
This commit is contained in:
parent
673fe2b56a
commit
04a9c8f3fd
@ -3018,7 +3018,6 @@ pub fn parse_math_expression(
|
||||
ty: result_ty,
|
||||
custom_completion: None,
|
||||
});
|
||||
// }
|
||||
}
|
||||
expr_stack.push(op);
|
||||
expr_stack.push(rhs);
|
||||
|
@ -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),
|
||||
|
@ -1232,3 +1232,8 @@ fn command_filter_reject_3() -> TestResult {
|
||||
]"#,
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn chained_operator_typecheck() -> TestResult {
|
||||
run_test("1 != 2 && 3 != 4 && 5 != 6", "true")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user