From 6cb98c905b0a75ea125481d945f3d315caf37c66 Mon Sep 17 00:00:00 2001 From: Lach Date: Wed, 26 Aug 2020 13:34:34 +0500 Subject: [PATCH] fix(evaluator): better error message for type mismatch --- crates/jrsonnet-evaluator/src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/jrsonnet-evaluator/src/error.rs b/crates/jrsonnet-evaluator/src/error.rs index e49081f9..59e798da 100644 --- a/crates/jrsonnet-evaluator/src/error.rs +++ b/crates/jrsonnet-evaluator/src/error.rs @@ -36,7 +36,7 @@ pub enum Error { #[error("variable is not defined: {0}")] VariableIsNotDefined(Rc), - #[error("type mismatch: expected {2}, got {1:?} {0}")] + #[error("type mismatch: expected {}, got {2} {0}", .1.iter().map(|e| format!("{}", e)).collect::>().join(", "))] TypeMismatch(&'static str, Vec, ValType), #[error("no such field: {0}")] NoSuchField(Rc),