git.delta.rocks / jrsonnet / refs/commits / 6cb98c905b0a

difftreelog

fix(evaluator) better error message for type mismatch

Lach2020-08-26parent: #21c8e9b.patch.diff
in: master

1 file changed

modifiedcrates/jrsonnet-evaluator/src/error.rsdiffbeforeafterboth
3636
37 #[error("variable is not defined: {0}")]37 #[error("variable is not defined: {0}")]
38 VariableIsNotDefined(Rc<str>),38 VariableIsNotDefined(Rc<str>),
39 #[error("type mismatch: expected {2}, got {1:?} {0}")]39 #[error("type mismatch: expected {}, got {2} {0}", .1.iter().map(|e| format!("{}", e)).collect::<Vec<_>>().join(", "))]
40 TypeMismatch(&'static str, Vec<ValType>, ValType),40 TypeMismatch(&'static str, Vec<ValType>, ValType),
41 #[error("no such field: {0}")]41 #[error("no such field: {0}")]
42 NoSuchField(Rc<str>),42 NoSuchField(Rc<str>),