Fix test for single overload functions

All functions are stored in the overload functions table, even those
that are never explicitly overloaded, but only explicitly overloaded
functions (those with @overload) use the type-qualified naming.
This commit is contained in:
Bill Currie 2020-02-14 20:39:12 +09:00
parent 533fb8acc9
commit 5d8d805b60

View file

@ -338,9 +338,12 @@ find_function (expr_t *fexpr, expr_t *params)
return fexpr;
for (func_count = 0; funcs[func_count]; func_count++)
;
if (func_count < 1) {
free (funcs);
return fexpr;
if (func_count < 2) {
f = (overloaded_function_t *) funcs[0];
if (func_count && !f->overloaded) {
free (funcs);
return fexpr;
}
}
type.t.func.type = ((overloaded_function_t *) funcs[0])->type->t.func.type;
dummy.type = find_type (&type);