summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOri Bernstein <ori@eigenstate.org>2018-06-11 08:28:21 -0700
committerOri Bernstein <ori@eigenstate.org>2018-06-11 08:28:21 -0700
commitc2f958658791d170d6864525749bf437241790e1 (patch)
treec31422801feb29680ae95e39ba6bb46b8ffc7a89
parent12da19e4d0545514a36f30bd7db39f428cfa67c5 (diff)
downloadmc-c2f958658791d170d6864525749bf437241790e1.tar.gz
Fix type env assertion.
If a subtype has args, it should introduce an env.
-rw-r--r--parse/type.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/parse/type.c b/parse/type.c
index 8674d8c..1606269 100644
--- a/parse/type.c
+++ b/parse/type.c
@@ -236,8 +236,8 @@ mktygeneric(Srcloc loc, Node *name, Type **param, size_t nparam, Type *base)
bindtype(t->env, param[i]);
if (!base->env)
base->env = t->env;
- else
- assert(base->env->super == t->env);
+ else
+ assert(base->env->super == t->env || base->narg > 0);
return t;
}