diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-03-03 13:01:49 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2023-03-03 13:01:49 +0100 |
| commit | f02334237a055f8da5bb795032c872e555abaec7 (patch) | |
| tree | 3e26499216fd8f92a7161f5fd7df3ce14749e54c /src/check_expr.cpp | |
| parent | d5ea492ef55c802f9c1f1930cd6413e1c366481f (diff) | |
| parent | 2d71ab6f2907c14651da8fb231a695b4a60f2c68 (diff) | |
Merge branch 'master' into pr/2359
Diffstat (limited to 'src/check_expr.cpp')
| -rw-r--r-- | src/check_expr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b4836416e..5338c0b67 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -2455,12 +2455,11 @@ gb_internal void check_comparison(CheckerContext *c, Ast *node, Operand *x, Oper } if (!defined) { - if (x->type == err_type && is_operand_nil(*x)) { - err_type = y->type; - } - gbString type_string = type_to_string(err_type, temporary_allocator()); + gbString xs = type_to_string(x->type, temporary_allocator()); + gbString ys = type_to_string(y->type, temporary_allocator()); err_str = gb_string_make(temporary_allocator(), - gb_bprintf("operator '%.*s' not defined for type '%s'", LIT(token_strings[op]), type_string)); + gb_bprintf("operator '%.*s' not defined between the types '%s' and '%s'", LIT(token_strings[op]), xs, ys) + ); } else { Type *comparison_type = x->type; if (x->type == err_type && is_operand_nil(*x)) { |