From 1f00b6a3f87f6adafe26e926ffaded54bba29b74 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. --- code/compiler/11/type.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/compiler/11/type.cpp b/code/compiler/11/type.cpp index 8022966..05e85c6 100644 --- a/code/compiler/11/type.cpp +++ b/code/compiler/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);