aboutsummaryrefslogtreecommitdiffstats
path: root/typing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'typing.cpp')
-rw-r--r--typing.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/typing.cpp b/typing.cpp
index 8487001..fd8e35e 100644
--- a/typing.cpp
+++ b/typing.cpp
@@ -108,9 +108,10 @@ AClosure::constrain(TEnv& tenv, Constraints& c) const
genericType = new AType(loc, tenv.penv.sym("Fn"),
tsubst.apply(protT), tsubst.apply(bodyT), 0);
tenv.genericTypes.insert(make_pair(this, genericType));
+ AST::pool.addRoot(genericType);
tenv.pop();
- subst = new Subst(tsubst);
+ subst = tsubst;
}
c.constrain(tenv, this, new AType(*genericType));
@@ -283,7 +284,7 @@ Subst::compose(const Subst& delta, const Subst& gamma) // TAPL 22.1.1
{
Subst r;
for (Subst::const_iterator g = gamma.begin(); g != gamma.end(); ++g) {
- Subst::const_iterator d = delta.find(*g->second);
+ Subst::const_iterator d = delta.find(g->second);
r.insert(make_pair(g->first, ((d != delta.end()) ? d : g)->second));
}
for (Subst::const_iterator d = delta.begin(); d != delta.end(); ++d) {