From b82b91ea08696535d48decef8b993f53d47087af Mon Sep 17 00:00:00 2001 From: gingerBill Date: Thu, 1 Sep 2022 15:15:51 +0100 Subject: Fix #1974 by erring on untyped parameters to `intrinsics.objc_send` --- src/check_builtin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/check_builtin.cpp') diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp index e55a2e024..6af1c3d44 100644 --- a/src/check_builtin.cpp +++ b/src/check_builtin.cpp @@ -341,6 +341,13 @@ bool check_builtin_objc_procedure(CheckerContext *c, Operand *operand, Ast *call for (isize i = 2+arg_offset; i < ce->args.count; i++) { Operand x = {}; check_expr(c, &x, ce->args[i]); + if (is_type_untyped(x.type)) { + gbString e = expr_to_string(x.expr); + gbString t = type_to_string(x.type); + error(x.expr, "'%.*s' expects typed parameters, got %s of type %s", LIT(builtin_name), e, t); + gb_string_free(t); + gb_string_free(e); + } param_types[i-arg_offset] = x.type; } -- cgit v1.2.3