fix some method bugs

This commit is contained in:
Bill Currie 2002-05-21 22:51:46 +00:00
parent 3815d4be7e
commit 2a73235d35
2 changed files with 7 additions and 3 deletions

View file

@ -273,8 +273,12 @@ emit_methods (methodlist_t *_methods, const char *name, int instance)
if (!_methods) if (!_methods)
return 0; return 0;
for (count = 0, method = _methods->head; method; method = method->next) for (count = 0, method = _methods->head; method; method = method->next)
if (!method->instance == !instance) if (!method->instance == !instance) {
if (!method->def) {
warning (0, "method %s not implemented", method->name);
}
count++; count++;
}
if (!count) if (!count)
return 0; return 0;
method_list = new_struct (0); method_list = new_struct (0);
@ -289,7 +293,7 @@ emit_methods (methodlist_t *_methods, const char *name, int instance)
methods->method_next = 0; methods->method_next = 0;
methods->method_count = count; methods->method_count = count;
for (i = 0, method = _methods->head; method; method = method->next) { for (i = 0, method = _methods->head; method; method = method->next) {
if (!method->instance != !instance) if (!method->instance != !instance || !method->def)
continue; continue;
methods->method_list[i].method_name.sel_id = ReuseString (method->name); methods->method_list[i].method_name.sel_id = ReuseString (method->name);
methods->method_list[i].method_name.sel_types = methods->method_list[i].method_name.sel_types =

View file

@ -1104,7 +1104,7 @@ methoddef
} }
| '-' methoddecl '=' '#' const ';' | '-' methoddecl '=' '#' const ';'
{ {
$2->instance = 0; $2->instance = 1;
$2 = class_find_method (current_class, $2); $2 = class_find_method (current_class, $2);
$2->def = method_def (current_class, $2); $2->def = method_def (current_class, $2);