ref: 2d534bb4fe76d68eb1ffb7805054d9acfef0e89e
parent: 6c44abcec8462f04e09db0ab62f74e4d1f384f5a
author: Ori Bernstein <ori@eigenstate.org>
date: Fri Jan 29 18:33:58 EST 2016
Comment to explain why eager unification is safe.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -955,6 +955,14 @@
}
r = NULL;
+ /*
+ * unify eagerly here, solving the problem of comparing two specialized types
+ * that don't have pointer equality.
+ *
+ * If the types *actually* conflict, we will error out later in this function,
+ * and the bogus unification won't matter. If the types *are* the same, though,
+ * then this short circuits a whole bunch of infinite recursion.
+ */
tytab[a->tid] = b;
if (a->type == Tyvar) {
ea = basetype(st, a);