mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
get -/+ into selector name for "does not respond to" warning.
This commit is contained in:
parent
f0c5a374d2
commit
8966b0a533
2 changed files with 7 additions and 4 deletions
|
@ -420,7 +420,7 @@ class_find_method (class_type_t *class_type, method_t *method)
|
|||
}
|
||||
|
||||
method_t *
|
||||
class_message_response (class_t *class, expr_t *sel)
|
||||
class_message_response (class_t *class, int class_msg, expr_t *sel)
|
||||
{
|
||||
pr_sel_t *selector;
|
||||
char *sel_name;
|
||||
|
@ -449,7 +449,8 @@ class_message_response (class_t *class, expr_t *sel)
|
|||
}
|
||||
c = c->super_class;
|
||||
}
|
||||
warning (sel, "%s does not respond to %s", class->name, sel_name);
|
||||
warning (sel, "%s does not respond to %c%s", class->name,
|
||||
class_msg ? '+' : '-', sel_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -2455,7 +2455,7 @@ message_expr (expr_t *receiver, keywordarg_t *message)
|
|||
expr_t *selector = selector_expr (message);
|
||||
expr_t *call;
|
||||
keywordarg_t *m;
|
||||
int super = 0;
|
||||
int super = 0, class_msg = 0;
|
||||
type_t *rec_type;
|
||||
class_t *class;
|
||||
method_t *method;
|
||||
|
@ -2474,6 +2474,8 @@ message_expr (expr_t *receiver, keywordarg_t *message)
|
|||
class = current_class->c.category->class;
|
||||
rec_type = class->type;
|
||||
} else {
|
||||
if (receiver->type == ex_name && get_class (receiver->e.string_val, 0))
|
||||
class_msg = 1;
|
||||
rec_type = get_type (receiver);
|
||||
|
||||
if (receiver->type == ex_error)
|
||||
|
@ -2486,7 +2488,7 @@ message_expr (expr_t *receiver, keywordarg_t *message)
|
|||
class = rec_type->aux_type->class;
|
||||
}
|
||||
if (rec_type != &type_id) {
|
||||
method = class_message_response (class, selector);
|
||||
method = class_message_response (class, class_msg, selector);
|
||||
if (method)
|
||||
rec_type = method->type->aux_type;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue