Make compiler check for arity in part 11 of compiler series.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danila Fedorin 2020-04-14 16:20:06 -07:00
parent acb22c4119
commit 1f00b6a3f8

View File

@ -114,7 +114,7 @@ void type_mgr::unify(type_ptr l, type_ptr r) {
return; return;
} else if((lid = dynamic_cast<type_base*>(l.get())) && } else if((lid = dynamic_cast<type_base*>(l.get())) &&
(rid = dynamic_cast<type_base*>(r.get()))) { (rid = dynamic_cast<type_base*>(r.get()))) {
if(lid->name == rid->name) return; if(lid->name == rid->name && lid->arity == rid->arity) return;
} else if((lapp = dynamic_cast<type_app*>(l.get())) && } else if((lapp = dynamic_cast<type_app*>(l.get())) &&
(rapp = dynamic_cast<type_app*>(r.get()))) { (rapp = dynamic_cast<type_app*>(r.get()))) {
unify(lapp->constructor, rapp->constructor); unify(lapp->constructor, rapp->constructor);