diff --git a/tools/qfcc/source/class.c b/tools/qfcc/source/class.c index 02bb3475f..e131cbff3 100644 --- a/tools/qfcc/source/class.c +++ b/tools/qfcc/source/class.c @@ -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; + } } } diff --git a/tools/qfcc/source/qc-parse.y b/tools/qfcc/source/qc-parse.y index 0fcd9e9fc..7365fed5b 100644 --- a/tools/qfcc/source/qc-parse.y +++ b/tools/qfcc/source/qc-parse.y @@ -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; } ;