From d09f333d0e06154290921ff4dcca3d9fe755d3b0 Mon Sep 17 00:00:00 2001 From: sterni Date: Mon, 29 May 2023 12:45:35 +0200 Subject: fix(tvix/eval): thunk lambda expressions As cl/8658 and b/274 reveal, lambda expressions are also wrapped in thunks. Resolves b/274. Change-Id: I02fe5c8730ac76748d940e4f4427116587875275 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8662 Autosubmit: sterni Tested-by: BuildkiteCI Reviewed-by: tazjin --- tvix/eval/src/compiler/mod.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'tvix/eval/src/compiler/mod.rs') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 773fc0f053..478d132758 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -284,11 +284,9 @@ impl Compiler<'_> { 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) => { - self.compile_lambda_or_thunk(false, slot, lambda, |c, s| { - c.compile_lambda(s, lambda) - }) - } + ast::Expr::Lambda(lambda) => self.thunk(slot, lambda, move |c, s| { + c.compile_lambda_or_thunk(false, s, lambda, |c, s| c.compile_lambda(s, lambda)) + }), ast::Expr::Apply(apply) => { self.thunk(slot, apply, move |c, s| c.compile_apply(s, apply)) } -- cgit 1.4.1