diff options
Diffstat (limited to 'src/constrain.cpp')
-rw-r--r-- | src/constrain.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/constrain.cpp b/src/constrain.cpp index 982f195..0c9951c 100644 --- a/src/constrain.cpp +++ b/src/constrain.cpp @@ -101,7 +101,7 @@ AFn::constrain(TEnv& tenv, Constraints& c) const (exp = *i)->constrain(tenv, c); AType* bodyT = tenv.var(exp); - AType* fnT = tup<AType>(loc, tenv.penv.sym("Fn"), protT, bodyT, 0); + AType* fnT = tup<AType>(loc, tenv.Fn, protT, bodyT, 0); Object::pool.addRoot(fnT); tenv.pop(); @@ -119,8 +119,7 @@ ACall::constrain(TEnv& tenv, Constraints& c) const if (fnType->kind != AType::VAR) { if (fnType->kind == AType::PRIM || fnType->size() < 2 - || !fnType->head()->to<const ASymbol*>() - || fnType->head()->to<const ASymbol*>()->cppstr != "Fn") + || fnType->head()->str() != "Fn") throw Error(loc, (format("call to non-function `%1%'") % head()->str()).str()); size_t numArgs = fnType->prot()->size(); @@ -133,7 +132,7 @@ ACall::constrain(TEnv& tenv, Constraints& c) const for (const_iterator i = begin() + 1; i != end(); ++i) argsT->push_back(tenv.var(*i)); - c.constrain(tenv, head(), tup<AType>(head()->loc, tenv.penv.sym("Fn"), argsT, retT, 0)); + c.constrain(tenv, head(), tup<AType>(head()->loc, tenv.Fn, argsT, retT, 0)); c.constrain(tenv, this, retT); } |