aboutsummaryrefslogtreecommitdiff
path: root/src/check_expr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/check_expr.cpp')
-rw-r--r--src/check_expr.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 3b470cb88..74ae02f94 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -8426,11 +8426,14 @@ gb_internal ExprKind check_call_expr(CheckerContext *c, Operand *operand, Ast *c
break;
case ProcTailing_must_tail:
is_call_tailed = true;
- if (proc != nullptr) {
- Entity *e = entity_from_expr(proc);
- if (e != nullptr && e->kind == Entity_Procedure) {
- // TODO(bill): `preserve_none`
- }
+ if (c->curr_proc_sig == nullptr || !are_types_identical(c->curr_proc_sig, pt)) {
+ ERROR_BLOCK();
+ gbString a = type_to_string(pt);
+ gbString b = type_to_string(c->curr_proc_sig);
+ error(call, "Use of '#must_tail' of a procedure must have the same type as the procedure it was called within");
+ error_line("\tCall type: %s, parent type: %s", a, b);
+ gb_string_free(b);
+ gb_string_free(a);
}
break;
}