ensure Operator::And errors out with incompatible types (#6638)

This commit is contained in:
pwygab 2022-09-29 19:17:21 +08:00 committed by GitHub
parent 7b9ad9d2e5
commit f5e1b08e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View File

@ -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,

View File

@ -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(),