forked from extern/nushell
ensure Operator::And errors out with incompatible types (#6638)
This commit is contained in:
parent
7b9ad9d2e5
commit
f5e1b08e6a
@ -408,7 +408,7 @@ pub fn eval_expression(
|
||||
|
||||
match op {
|
||||
Operator::And => {
|
||||
if !lhs.is_true() {
|
||||
if lhs.is_false() {
|
||||
Ok(Value::Bool {
|
||||
val: false,
|
||||
span: expr.span,
|
||||
|
@ -1176,6 +1176,10 @@ impl Value {
|
||||
matches!(self, Value::Bool { val: true, .. })
|
||||
}
|
||||
|
||||
pub fn is_false(&self) -> bool {
|
||||
matches!(self, Value::Bool { val: false, .. })
|
||||
}
|
||||
|
||||
pub fn columns(&self) -> Vec<String> {
|
||||
match self {
|
||||
Value::Record { cols, .. } => cols.clone(),
|
||||
|
Loading…
Reference in New Issue
Block a user