Assertion in debug version on return-from within a map().
MortimerSnerd opened this issue · comments
With master e962261
I wasn't seeing any problems in the release version of lobster, but ran the debug version to check out something unrelated, and it would fail code generation with this assertion:
Isom3/src% lobster-debug /tmp/bingus.lobster
lobster-debug: /home/pkelley/src/lobster/dev/src/lobster/codegen.h:1681: virtual void lobster::Return::Generate(lobster::CodeGen&, size_t) const: Assertion `cg.temptypestack.size() ==
cg.LoopTemps()' failed.
Here's an example that reproduces the problem:
import std
def funfun():
return map(10) x:
if x >= 0:
x*x
else:
return [] from funfun
print(funfun())
Thanks for reporting! Yes, that assert was outdated, so I just removed it.
Does look like there may be some related issues lurking, which I'll get to later.