ref: 1b09d79abf7fbb487958224eb148dd66bf38b253
parent: 0af648321d764657b71a996be5397ecdb9e7d600
author: Ori Bernstein <[email protected]>
date: Wed Dec 25 11:39:54 EST 2013
Don't error on resolving specialized generics. type resolution should never throw errors about non-generics showing up within a generic type, so we push and pop a generic around resolution
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -253,6 +253,10 @@
if (t->resolved)
return;
+ /* type resolution should never throw errors about non-generics
+ * showing up within a generic type, so we push and pop a generic
+ * around resolution */
+ st->ingeneric++;
t->resolved = 1;
/* Walk through aggregate type members */
if (t->type == Tystruct) {
@@ -281,6 +285,7 @@
t->cstrs = bsdup(base->cstrs);
if (tyinfinite(st, t, NULL))
fatal(t->line, "Type %s includes itself", tystr(t));
+ st->ingeneric--;
}
/* Look up the best type to date in the unification table, returning it */