From 80aaadfc199c4038b69c89f3493528f09c28efc2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 13 Mar 2023 12:21:31 +0300 Subject: fix(tvix/eval): use span of `set` for OpForce in attribute access Emits the span of the `set` that is being accessed in the `force` operation of an attribute access. Looking at traces, it's a lot more useful to get information about *what* is being forced, as in cases like `foo.bar` it can be misleading to have an error highlight `bar`, when the error occured while forcing `foo` to be able to access `bar` in the first place. Change-Id: Id46ff28f20c67cb4971727ac52cc4811795cea2d Reviewed-on: https://cl.tvl.fyi/c/depot/+/8272 Reviewed-by: flokli Autosubmit: tazjin Tested-by: BuildkiteCI --- tvix/eval/src/compiler/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tvix/eval/src') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 51dc49242882..7f090978db99 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -683,7 +683,7 @@ impl Compiler<'_> { } // Push the set onto the stack - self.compile(slot, set); + self.compile(slot, set.clone()); if self.optimise_select(&path) { return; } @@ -694,7 +694,7 @@ impl Compiler<'_> { // nested selects. for fragment in path.attrs() { // Force the current set value. - self.emit_force(&fragment); + self.emit_force(&set); self.compile_attr(slot, &fragment); self.push_op(OpCode::OpAttrsSelect, &fragment); -- cgit 1.4.1