diff --git a/crates/jrsonnet-evaluator/src/evaluate.rs b/crates/jrsonnet-evaluator/src/evaluate.rs index 90c8a76b..6114d08a 100644 --- a/crates/jrsonnet-evaluator/src/evaluate.rs +++ b/crates/jrsonnet-evaluator/src/evaluate.rs @@ -589,9 +589,11 @@ pub fn evaluate(context: Context, expr: &LocExpr) -> Result { cond_then, cond_else, } => { - if evaluate(context.clone(), &cond.0)? - .try_cast_bool("if condition should be of type `boolean`")? - { + if push( + loc, + || "if condition".to_owned(), + || evaluate(context.clone(), &cond.0)?.try_cast_bool("in if condition"), + )? { evaluate(context, cond_then)? } else { match cond_else {