aboutsummaryrefslogtreecommitdiffstats
path: root/src/unify.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-06-29 06:38:59 +0000
committerDavid Robillard <d@drobilla.net>2009-06-29 06:38:59 +0000
commitbcc1bc3a8c648daa059daf832ac04ad907c58129 (patch)
tree156caa4910f59858d60c86db9d45a74d6d2e7c14 /src/unify.cpp
parent104ad6fde8f16f6f10fc1e94492f7358748abb57 (diff)
downloadresp-bcc1bc3a8c648daa059daf832ac04ad907c58129.tar.gz
resp-bcc1bc3a8c648daa059daf832ac04ad907c58129.tar.bz2
resp-bcc1bc3a8c648daa059daf832ac04ad907c58129.zip
Tidy.
git-svn-id: http://svn.drobilla.net/resp/tuplr@169 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src/unify.cpp')
-rw-r--r--src/unify.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/unify.cpp b/src/unify.cpp
index d2bd055..864ea81 100644
--- a/src/unify.cpp
+++ b/src/unify.cpp
@@ -89,11 +89,12 @@ unify(const Constraints& constraints)
cp.replace(t, s);
return Subst::compose(unify(cp), Subst(t, s));
} else if (s->kind == AType::EXPR && s->kind == t->kind && s->size() == t->size()) {
- for (size_t i = 0; i < s->size(); ++i) {
+ assert(*s->at(0)->to<ASymbol*>() == *t->at(0)->to<ASymbol*>());
+ for (size_t i = 1; i < s->size(); ++i) {
AType* si = s->at(i)->to<AType*>();
AType* ti = t->at(i)->to<AType*>();
- if (si && ti)
- cp.push_back(Constraint(si, ti, si->loc));
+ assert(si && ti);
+ cp.push_back(Constraint(si, ti, si->loc));
}
return unify(cp);
} else {