feat(tvix/eval): unthunk empty lists and attribute sets

Change-Id: Ie66cb1b163a544d45d113fd0f866286f230b0188
Reviewed-on: https://cl.tvl.fyi/c/depot/+/7960
Tested-by: BuildkiteCI
Reviewed-by: grfn <grfn@gws.fyi>
This commit is contained in:
Vincent Ambo 2023-01-30 00:45:40 +03:00 committed by tazjin
parent 5d3fb33baa
commit 22776280b5
2 changed files with 8 additions and 0 deletions

View file

@ -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.

View file

@ -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();
}