From 5612ec0f41457d0972440a18b677ee6e740e6b23 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 22 Oct 2022 19:59:06 +0300 Subject: fix(tvix/eval): thunk let-expression 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 --- tvix/eval/src/compiler/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'tvix/eval') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 9c8f0078f3..2ab7662386 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) => { -- cgit 1.4.1