From 9420a3b53d47b0a71d837e312c49fb1d94af1592 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 29 Aug 2022 22:06:28 +0300 Subject: feat(tvix/eval): insert strictness points for attribute set keys All attribute set *key* related operations strictly evaluate all key fragments, including during construction of an attribute set. Change-Id: I3519e5e9b0886c2cdc8615ea7dcb5f7be0c59b3f Reviewed-on: https://cl.tvl.fyi/c/depot/+/6358 Tested-by: BuildkiteCI Reviewed-by: sterni --- tvix/eval/src/compiler/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 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 b3315ee9119e..8a2fb5eb97e2 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -367,8 +367,16 @@ impl Compiler { fn compile_attr(&mut self, slot: Option, node: ast::Attr) { match node { - ast::Attr::Dynamic(dynamic) => self.compile(slot, dynamic.expr().unwrap()), - ast::Attr::Str(s) => self.compile_str(slot, s), + ast::Attr::Dynamic(dynamic) => { + self.compile(slot, dynamic.expr().unwrap()); + self.emit_force(); + } + + ast::Attr::Str(s) => { + self.compile_str(slot, s); + self.emit_force(); + } + ast::Attr::Ident(ident) => self.emit_literal_ident(&ident), } } -- cgit 1.4.1