about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/compiler/bindings.rs4
-rw-r--r--tvix/eval/src/compiler/mod.rs4
2 files changed, 8 insertions, 0 deletions
diff --git a/tvix/eval/src/compiler/bindings.rs b/tvix/eval/src/compiler/bindings.rs
index 2e703aadc8..a3d7c6fbfb 100644
--- a/tvix/eval/src/compiler/bindings.rs
+++ b/tvix/eval/src/compiler/bindings.rs
@@ -658,6 +658,10 @@ impl Compiler<'_> {
         if kind.is_attrs() {
             self.push_op(OpCode::OpAttrs(Count(count)), node);
         }
+
+        if count == 0 {
+            self.unthunk();
+        }
     }
 
     /// Compile a standard `let ...; in ...` expression.
diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs
index bfb823b673..c7061c77a0 100644
--- a/tvix/eval/src/compiler/mod.rs
+++ b/tvix/eval/src/compiler/mod.rs
@@ -592,6 +592,10 @@ impl Compiler<'_> {
             self.scope_mut().mark_initialised(item_slot);
         }
 
+        if count == 0 {
+            self.unthunk();
+        }
+
         self.push_op(OpCode::OpList(Count(count)), node);
         self.scope_mut().end_scope();
     }