aboutsummaryrefslogtreecommitdiffstats
path: root/src/unify.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/unify.cpp')
-rw-r--r--src/unify.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/unify.cpp b/src/unify.cpp
index 92957c0..5255f54 100644
--- a/src/unify.cpp
+++ b/src/unify.cpp
@@ -109,7 +109,9 @@ Constraints::replace(AType* s, AType* t)
Subst
unify(const Constraints& constraints)
{
- if (constraints.empty()) return Subst();
+ if (constraints.empty())
+ return Subst();
+
AType* s = constraints.begin()->first;
AType* t = constraints.begin()->second;
Constraints cp = constraints;
@@ -127,6 +129,8 @@ unify(const Constraints& constraints)
AType::iterator si = s->begin() + 1;
AType::iterator ti = t->begin() + 1;
for (; si != s->end() && ti != t->end(); ++si, ++ti) {
+ if ((*si)->str() == "..." || (*ti)->str() == "...")
+ return unify(cp);
AType* st = (*si)->to<AType*>();
AType* tt = (*ti)->to<AType*>();
assert(st && tt);