mirror of
https://github.com/odin-lang/Odin.git
synced 2026-09-02 18:23:35 +00:00
diagnostics: let compiler check error() fmt strings + fixes
This commit is contained in:
@@ -7380,24 +7380,24 @@ gb_internal void check_objc_context_provider_procedures(Checker *c) {
|
||||
|
||||
const char *self_param_err = "The @(objc_context_provider) procedure must take as a parameter a single pointer to the @(objc_type) value.";
|
||||
if (proc.param_count != 1) {
|
||||
error(proc_entity->token, self_param_err);
|
||||
error(proc_entity->token, "%s", self_param_err);
|
||||
}
|
||||
|
||||
Type *self_param = base_type(proc.params->Tuple.variables[0]->type);
|
||||
if (self_param->kind != Type_Pointer) {
|
||||
error(proc_entity->token, self_param_err);
|
||||
error(proc_entity->token, "%s", self_param_err);
|
||||
}
|
||||
|
||||
Type *self_type = base_named_type(self_param->Pointer.elem);
|
||||
if (!internal_check_is_assignable_to(self_type, e->type) &&
|
||||
!(e->TypeName.objc_ivar && internal_check_is_assignable_to(self_type, e->TypeName.objc_ivar))) {
|
||||
error(proc_entity->token, self_param_err);
|
||||
error(proc_entity->token, "%s", self_param_err);
|
||||
}
|
||||
if (proc.calling_convention != ProcCC_CDecl && proc.calling_convention != ProcCC_Contextless) {
|
||||
error(e->token, self_param_err);
|
||||
error(e->token, "%s", self_param_err);
|
||||
}
|
||||
if (proc.is_polymorphic) {
|
||||
error(e->token, self_param_err);
|
||||
error(e->token, "%s", self_param_err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user