From 10c6cb7251480ca12e67b3d237740e6dcb93f87e Mon Sep 17 00:00:00 2001 From: sterni Date: Fri, 2 Jun 2023 22:38:00 +0200 Subject: fix(tvix/eval): type check function argument with set pattern C++ Nix forces and typechecks the passed argument even if it is not necessary in order to compute the return value of the function. I discovered this when I thought our formals miscompilation might be that we are too strict, but doesn't look like it in this case. Change-Id: Ifb3c92592293052c489d1e3ae8c7c54e4b6b4dc6 Reviewed-on: https://cl.tvl.fyi/c/depot/+/8701 Tested-by: BuildkiteCI Autosubmit: sterni Reviewed-by: tazjin --- tvix/eval/src/compiler/mod.rs | 1 + 1 file changed, 1 insertion(+) (limited to 'tvix/eval/src/compiler') diff --git a/tvix/eval/src/compiler/mod.rs b/tvix/eval/src/compiler/mod.rs index 75d9d94475a2..450799d683d1 100644 --- a/tvix/eval/src/compiler/mod.rs +++ b/tvix/eval/src/compiler/mod.rs @@ -910,6 +910,7 @@ impl Compiler<'_> { // the stack. self.scope_mut().mark_initialised(set_idx); self.emit_force(pattern); + self.push_op(OpCode::OpAssertAttrs, pattern); let ellipsis = pattern.ellipsis_token().is_some(); if !ellipsis { -- cgit 1.4.1