aboutsummaryrefslogtreecommitdiffstats
path: root/src/constrain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r--src/constrain.cpp8
1 files changed, 4 insertions, 4 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;