Merge data type mismatch errors.

This commit is contained in:
Stephen Chung
2020-10-05 13:45:57 +08:00
parent b67a743306
commit 82d48df734
5 changed files with 92 additions and 150 deletions

View File

@@ -35,9 +35,7 @@ fn test_custom_syntax() -> Result<(), Box<EvalAltResult>> {
if !engine
.eval_expression_tree(context, scope, expr)?
.as_bool()
.map_err(|_| {
EvalAltResult::ErrorBooleanArgMismatch("do-while".into(), expr.position())
})?
.map_err(|err| engine.make_type_mismatch_err::<bool>(err, expr.position()))?
{
break;
}