fix(tvix/eval): Force thunks during equality comparison
Thunks might be encountered deep in equality comparison (eg nested inside a list or attr-set), at which point we need to force them in order to compare them for equality (or else we panic when trying to get at their value). Fixes: b/192 Change-Id: I912151085f8298f30d5214c7965251c9266443f2 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6652 Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
This commit is contained in:
parent
0b76ed5615
commit
6f70f32513
3 changed files with 20 additions and 5 deletions
|
@ -0,0 +1 @@
|
|||
[ true true false ]
|
11
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix
Normal file
11
tvix/eval/src/tests/tvix_tests/eval-okay-lazy-equality.nix
Normal file
|
@ -0,0 +1,11 @@
|
|||
let
|
||||
attrs1 = { x = 1 + 2; };
|
||||
attrs2 = { x = 2 + 1; };
|
||||
list1 = [ (1 + 2) ];
|
||||
list2 = [ (2 + 1) ];
|
||||
list3 = [ (2 + 2) ];
|
||||
in [
|
||||
(attrs1 == attrs2)
|
||||
(list1 == list2)
|
||||
(list3 == list2)
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue