diff --git a/oden-script/src/parser.rs b/oden-script/src/parser.rs index 2753a872..bc98d520 100644 --- a/oden-script/src/parser.rs +++ b/oden-script/src/parser.rs @@ -599,6 +599,18 @@ mod tests { "cannot apply unary operator '-' to expression of type 'string'" ); + test_type_error_expr!( + add_string_number, + "'what?' + 5", + "cannot apply binary operator '+' to expressions of type 'string' (on the left) and 'f64' (on the right)" + ); + + test_type_error_expr!( + add_number_string, + "5 + 'what?'", + "cannot apply binary operator '+' to expressions of type 'f64' (on the left) and 'string' (on the right)" + ); + test_type_error_expr!( errors_propagate_do_not_duplicate, "!'hello' / 27 * -('what?') + 23",