ref: f9b54e1fcf403c9c8386133f1482b2fc315e8ae1
parent: 3e9a366b35c16c7f372b56c47ba020cbf61f9937
author: Ori Bernstein <[email protected]>
date: Wed Dec 16 16:18:33 EST 2015
Our marking of vatypes was wrong. Just generate the names for each type. Our binaries will be bigger, but only marginally.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -980,14 +980,6 @@
return r;
}
-static void markvatypes(Type **types, size_t ntypes)
-{
- size_t i;
-
- for (i = 0; i < ntypes; i++)
- types[i]->isreflect = 1;
-}
-
/* Applies unifications to function calls.
* Funciton application requires a slightly
* different approach to unification. */
@@ -1014,7 +1006,6 @@
ctxstr(st, n->expr.args[0]), ft->nsub - 1, n->expr.nargs - 1);
if (ft->sub[i]->type == Tyvalist) {
- markvatypes(&ft->sub[i], ft->nsub - i);
break;
}
inferexpr(st, &n->expr.args[i], NULL, NULL);
--- a/parse/type.c
+++ b/parse/type.c
@@ -209,6 +209,7 @@
t->traits = bsdup(base->traits);
t->sub = xalloc(sizeof(Type *));
t->sub[0] = base;
+ t->isreflect = 1;
return t;
}