aboutsummaryrefslogtreecommitdiffstats
path: root/ll.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'll.cpp')
-rw-r--r--ll.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/ll.cpp b/ll.cpp
index 8de28fc..e6822c6 100644
--- a/ll.cpp
+++ b/ll.cpp
@@ -786,16 +786,13 @@ ASTIf::compile(CEnv& cenv)
void
ASTClosure::lift(CEnv& cenv)
{
- assert(!func);
-
// Can't lift a closure with variable types (lift later when called)
+ if (cenv.tenv.type(body)->var) return;
for (size_t i = 0; i < prot->tup.size(); ++i)
if (cenv.tenv.type(prot->tup[i])->var)
return;
- if (cenv.tenv.type(body)->var)
- return;
-
+ assert(!func);
cenv.code.push_front();
// Write function declaration