ref: bef1877e245cc389dacbf1abafc174716337334d
parent: 27d6ae05d6408b4b2c9fb6b58799f503ddb1b6d6
author: Ori Bernstein <[email protected]>
date: Thu Oct 24 09:27:18 EDT 2013
Check that named types are the same when unifying.
--- a/parse/infer.c
+++ b/parse/infer.c
@@ -638,6 +638,8 @@
/* if the tyrank of a is 0 (ie, a raw tyvar), just unify.
* Otherwise, match up subtypes. */
if ((a->type == b->type || idxhacked(a, b)) && tyrank(a) != 0) {
+ if (a->type == Tyname && !nameeq(a->name, b->name))
+ typeerror(st, a, b, ctx, NULL);
if (a->nsub != b->nsub) {
snprintf(buf, sizeof buf, "Wrong subtype count - Got %zu, expected %zu", a->nsub, b->nsub);
typeerror(st, a, b, ctx, buf);