From 9d16d3840a4314788e177e7e457e6236ca4214b1 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Tue, 14 Apr 2020 16:20:06 -0700 Subject: [PATCH] Make compiler check for arity in part 11 of compiler series. --- 11/type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/11/type.cpp b/11/type.cpp index 8022966..05e85c6 100644 --- a/11/type.cpp +++ b/11/type.cpp @@ -114,7 +114,7 @@ void type_mgr::unify(type_ptr l, type_ptr r) { return; } else if((lid = dynamic_cast(l.get())) && (rid = dynamic_cast(r.get()))) { - if(lid->name == rid->name) return; + if(lid->name == rid->name && lid->arity == rid->arity) return; } else if((lapp = dynamic_cast(l.get())) && (rapp = dynamic_cast(r.get()))) { unify(lapp->constructor, rapp->constructor);