diff options
author | Vincent Ambo <mail@tazj.in> | 2022-10-22T16·59+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2022-10-23T15·50+0000 |
commit | 5612ec0f41457d0972440a18b677ee6e740e6b23 (patch) | |
tree | 84e74da14b089f2a04574b74f19031c6cb183b40 /tvix/eval/src/compiler/mod.rs | |
parent | 5b305fab409be662092ab8214db7c4c1c91b8fb8 (diff) |
fix(tvix/eval): thunk let-expression r/5184
There are some rare scope cases with deferred access where this doesn't behave correctly otherwise. Change-Id: I6c774f5e62c1cb50b598026c54727017a52cd22d Reviewed-on: https://cl.tvl.fyi/c/depot/+/7064 Tested-by: BuildkiteCI Reviewed-by: sterni <sternenseemann@systemli.org>
Diffstat (limited to 'tvix/eval/src/compiler/mod.rs')
-rw-r--r-- | tvix/eval/src/compiler/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 9c8f0078f36a..2ab76623864b 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -224,7 +224,11 @@ impl Compiler<'_> { ast::Expr::IfElse(if_else) => { self.thunk(slot, if_else, move |c, s| c.compile_if_else(s, if_else)) } - ast::Expr::LetIn(let_in) => self.compile_let_in(slot, let_in), + + ast::Expr::LetIn(let_in) => { + self.thunk(slot, let_in, move |c, s| c.compile_let_in(s, let_in)) + } + ast::Expr::Ident(ident) => self.compile_ident(slot, ident), ast::Expr::With(with) => self.thunk(slot, with, |c, s| c.compile_with(s, with)), ast::Expr::Lambda(lambda) => { |