don't change the hidden parm type for protocol methods until they're used in a class

This commit is contained in:
Bill Currie 2002-08-13 21:18:17 +00:00
parent fa6f3cb09d
commit 2f4094344b
2 changed files with 8 additions and 1 deletions

View file

@ -154,11 +154,17 @@ class_add_protocol_methods (class_t *class, expr_t *protocols)
class->methods = new_methodlist ();
for (e = protocols; e; e = e->next) {
method_t **m = class->methods->tail;
if (!(p = get_protocol (e->e.string_val, 0))) {
error (e, "undefined protocol `%s'", e->e.string_val);
continue;
}
copy_methods (class->methods, p->methods);
while (*m) {
(*m)->params->type = class->type;
printf("%s\n", (*m)->name);
m = &(*m)->next;
}
}
}

View file

@ -1170,7 +1170,8 @@ methodproto
| '-' methoddecl ';'
{
$2->instance = 1;
$2->params->type = current_class->type;
if (current_class)
$2->params->type = current_class->type;
$$ = $2;
}
;