aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/types.c
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/types.c')
-rw-r--r--bootstrap/types.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bootstrap/types.c b/bootstrap/types.c
index 7491b4b..386ad58 100644
--- a/bootstrap/types.c
+++ b/bootstrap/types.c
@@ -52,6 +52,7 @@ hashtype(const struct type *ty) {
h = jkhashv(h, ty->fn.params.n);
for (int i = 0; i < ty->fn.params.n; ++i)
h = jkhashv(h, ty->fn.params.d[i]->_id);
+ break;
case TYenum:
h = jkhashv(h, ty->enu.id);
break;
@@ -81,7 +82,9 @@ typeeql(const struct type *lhs, const struct type *rhs) {
case TYarr:
return lhs->length == rhs->length && typeeql(lhs->child, rhs->child);
case TYfn:
- if (lhs->length != rhs->length)
+ if (lhs->fn.params.n != rhs->fn.params.n)
+ return 0;
+ if (lhs->fn.variadic != rhs->fn.variadic)
return 0;
for (int i = 0; i < lhs->fn.params.n; ++i)
if (!typeeql(lhs->fn.params.d[i], rhs->fn.params.d[i]))