diff --git a/tvix/eval/src/compiler.rs b/tvix/eval/src/compiler.rs index 6bb75f92c..4b7a7b44a 100644 --- a/tvix/eval/src/compiler.rs +++ b/tvix/eval/src/compiler.rs @@ -568,7 +568,7 @@ impl Compiler { self.compile_with_literal_ident(next)?; for fragment in fragments.into_iter().rev() { - self.chunk.push_op(OpCode::OpAttrsSelect); + self.chunk.push_op(OpCode::OpAttrOrNotFound); self.compile_with_literal_ident(fragment)?; } diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.exp new file mode 100644 index 000000000..c508d5366 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.exp @@ -0,0 +1 @@ +false diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix new file mode 100644 index 000000000..361ba9144 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-contains-nested-non-set.nix @@ -0,0 +1,3 @@ +# ? operator should work even if encountering a non-set value on the +# walk +{ a.b = 42; } ? a.b.c