Skip to content

Commit

Permalink
Well that was easier than I thaught. Closes #41
Browse files Browse the repository at this point in the history
  • Loading branch information
aDotInTheVoid committed May 3, 2021
1 parent 440f09f commit 895ba73
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/exec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,11 @@ impl<'a> Env<'a> {
scope.declare(&name.name, val.clone());
}

// Weird workaroud for rust-lang/rust#59159, see #41
let body = &function.body;

// In functions, a trailing expression returns
Ok(match self.eval_block_in(&function.body, &mut scope)? {
Ok(match self.eval_block_in(body, &mut scope)? {
BlockEvalResult::FnRet(x) => x,
BlockEvalResult::LocalRet(x) => x,
})
Expand Down

0 comments on commit 895ba73

Please sign in to comment.