diff options
Diffstat (limited to 'tuplr_llvm.cpp')
-rw-r--r-- | tuplr_llvm.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/tuplr_llvm.cpp b/tuplr_llvm.cpp index 4ed3ba5..8d1f1db 100644 --- a/tuplr_llvm.cpp +++ b/tuplr_llvm.cpp @@ -208,14 +208,9 @@ void ASTClosure::lift(CEnv& cenv) { AType* type = cenv.tenv.type(this); - if (!type->concrete()) { - err << "closure is untyped, not lifting" << endl; + if (!type->concrete() || funcs.find(type)) return; - } - if (funcs.find(type)) - return; - cenv.push(); // Write function declaration @@ -288,7 +283,7 @@ ASTCall::compile(CEnv& cenv) } assert(c); - Function* f = dynamic_cast<Function*>(LLVal(cenv.compile(c))); + Function* f = dynamic_cast<Function*>(LLVal(c->compile(cenv))); if (!f) throw Error("callee failed to compile", exp.loc); vector<Value*> params(size() - 1); @@ -570,8 +565,7 @@ repl(CEnv& cenv) cenv.tenv.solve(); // Solve and apply type constraints AType* bodyT = cenv.tenv.type(body); - if (!bodyT) throw Error("call to untyped body", cursor); - if (!bodyT->concrete()) throw Error("call to variable typed body", cursor); + if (!bodyT) throw Error("call to untyped body", cursor); body->lift(cenv); |