1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-12 21:46:01 +01:00

Add tests/f/lang/eval-okay-tryeval-failed-thunk-reeval

This commit is contained in:
Robert Hensing 2025-09-10 12:49:11 +02:00
parent b13143280c
commit 6de4db100f
3 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1 @@
trace: throwing

View file

@ -0,0 +1 @@
"done"

View file

@ -0,0 +1,7 @@
# Since Nix 2.32, errors are memoized
let
# This attribute value will only be evaluated once.
foo = builtins.trace "throwing" throw "nope";
in
# Trigger and catch the error twice.
builtins.seq (builtins.tryEval foo).success builtins.seq (builtins.tryEval foo).success "done"