diff options
-rw-r--r-- | src/constrain.cpp | 8 | ||||
-rw-r--r-- | src/unify.cpp | 1 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 10cb380..97af0af 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -36,7 +36,7 @@ CONSTRAIN_LITERAL(bool, "Bool") void AString::constrain(TEnv& tenv, Constraints& c) const { - c.push_back(Constraint(tenv.var(this), tenv.named("String"), loc)); + c.constrain(tenv, this, tenv.named("String")); } void @@ -44,7 +44,7 @@ ASymbol::constrain(TEnv& tenv, Constraints& c) const { AType** ref = tenv.ref(this); THROW_IF(!ref, loc, (format("undefined symbol `%1%'") % cppstr).str()); - c.push_back(Constraint(tenv.var(this), *ref, loc)); + c.constrain(tenv, this, *ref); } void @@ -55,7 +55,7 @@ ATuple::constrain(TEnv& tenv, Constraints& c) const (*p)->constrain(tenv, c); t->push_back(tenv.var(*p)); } - c.push_back(Constraint(tenv.var(this), t, loc)); + c.constrain(tenv, this, t); } void @@ -81,7 +81,7 @@ AFn::constrain(TEnv& tenv, Constraints& c) const frame.push_back(make_pair(sym, tvar)); protT->push_back(tvar); } - c.push_back(Constraint(tenv.var(at(1)), protT, at(1)->loc)); + c.constrain(tenv, at(1), protT); // Add internal definitions to environment frame size_t e = 2; diff --git a/src/unify.cpp b/src/unify.cpp index 8aac926..38f2583 100644 --- a/src/unify.cpp +++ b/src/unify.cpp @@ -55,7 +55,6 @@ TEnv::buildSubst(AType* genericT, const AType& argsT) return subst; } - void Constraints::constrain(TEnv& tenv, const AST* o, AType* t) { |