aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgingerBill <gingerBill@users.noreply.github.com>2025-12-30 12:58:43 +0000
committergingerBill <gingerBill@users.noreply.github.com>2025-12-30 12:58:43 +0000
commite61228484a72ff86f47b593d613afa3cb2d0065d (patch)
tree0cb2ae7b46c0315886a9794ed25006aaa7a9e08c /src
parentf1c6c52c215c8087a4fb82b68dcf03741cb8821b (diff)
parentbbd4c38f8f48c4c6db554a46760bb11e7c0209c1 (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
Diffstat (limited to 'src')
-rw-r--r--src/check_expr.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/check_expr.cpp b/src/check_expr.cpp
index 2fe6c0251..3b32d734a 100644
--- a/src/check_expr.cpp
+++ b/src/check_expr.cpp
@@ -8172,13 +8172,7 @@ gb_internal void check_objc_call_expr(CheckerContext *c, Operand *operand, Ast *
Type *return_type = proc.result_count == 0 ? nullptr : proc.results->Tuple.variables[0]->type;
bool is_return_instancetype = return_type != nullptr && return_type == t_objc_instancetype;
- if (params.count == 0 || !is_type_objc_ptr_to_object(params[0]->type)) {
- if (!proc_entity->Procedure.is_objc_class_method) {
- // Not a class method, invalid call
- error(call, "Invalid Objective-C call: The Objective-C method is not a class method but this first parameter is not an Objective-C object pointer.");
- return;
- }
-
+ if (proc_entity->Procedure.is_objc_class_method) {
if (is_return_instancetype) {
if (ce->proc->kind == Ast_SelectorExpr) {
ast_node(se, SelectorExpr, ce->proc);
@@ -8194,7 +8188,8 @@ gb_internal void check_objc_call_expr(CheckerContext *c, Operand *operand, Ast *
self_type = t_objc_Class;
params_start = 0;
- } else if (ce->args.count > 0) {
+ } else {
+ GB_ASSERT(ce->args.count > 0);
GB_ASSERT(is_type_objc_ptr_to_object(params[0]->type));
if (ce->args[0]->tav.objc_super_target) {