aboutsummaryrefslogtreecommitdiff
path: root/src/check_builtin.cpp
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-02-11 22:54:51 +0000
committergingerBill <bill@gingerbill.org>2022-02-11 22:54:51 +0000
commitf8afda3b221f6c2279a393c2c0fb8ab7ea1d59df (patch)
tree650b932fc9e448dfe283932636195abf71c7d77b /src/check_builtin.cpp
parent416413bebfcddf2b7ae2bf20fb01b675339297eb (diff)
Add more objc attributes
Diffstat (limited to 'src/check_builtin.cpp')
-rw-r--r--src/check_builtin.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/check_builtin.cpp b/src/check_builtin.cpp
index df22d82e2..a9ee5d25f 100644
--- a/src/check_builtin.cpp
+++ b/src/check_builtin.cpp
@@ -287,15 +287,13 @@ bool check_builtin_objc_procedure(CheckerContext *c, Operand *operand, Ast *call
Operand self = {};
check_expr_or_type(c, &self, ce->args[1]);
if (self.mode == Addressing_Type) {
- if (!internal_check_is_assignable_to(self.type, t_objc_object)) {
+ if (!is_type_objc_object(self.type)) {
gbString t = type_to_string(self.type);
error(self.expr, "'%.*s' expected a type or value derived from intrinsics.objc_object, got type %s", LIT(builtin_name), t);
gb_string_free(t);
return false;
}
- if (!(self.type->kind == Type_Named &&
- self.type->Named.type_name != nullptr &&
- self.type->Named.type_name->TypeName.objc_class_name != "")) {
+ if (!has_type_got_objc_class_attribute(self.type)) {
gbString t = type_to_string(self.type);
error(self.expr, "'%.*s' expected a named type with the attribute @(obj_class=<string>) , got type %s", LIT(builtin_name), t);
gb_string_free(t);
@@ -306,7 +304,7 @@ bool check_builtin_objc_procedure(CheckerContext *c, Operand *operand, Ast *call
} else if (!is_operand_value(self) || !check_is_assignable_to(c, &self, t_objc_id)) {
gbString e = expr_to_string(self.expr);
gbString t = type_to_string(self.type);
- error(self.expr, "'%.*s'3 expected a type or value derived from intrinsics.objc_object, got '%s' of type %s %d", LIT(builtin_name), e, t, self.type->kind);
+ error(self.expr, "'%.*s' expected a type or value derived from intrinsics.objc_object, got '%s' of type %s %d", LIT(builtin_name), e, t, self.type->kind);
gb_string_free(t);
gb_string_free(e);
return false;