about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--tvix/eval/src/builtins/mod.rs1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix1
3 files changed, 3 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index c2618a4066f4..554fc9d7e329 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -135,6 +135,7 @@ mod pure_builtins {
     async fn builtin_base_name_of(co: GenCo, s: Value) -> Result<Value, ErrorKind> {
         let span = generators::request_span(&co).await;
         let s = match s {
+            val @ Value::Catchable(_) => return Ok(val),
             // it is important that builtins.baseNameOf does not
             // coerce paths into strings, since this will turn them
             // into store paths, and `builtins.baseNameOf
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp
new file mode 100644
index 000000000000..c508d5366f70
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.exp
@@ -0,0 +1 @@
+false
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix
new file mode 100644
index 000000000000..f47c6f22bbe3
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-basenameof-propagate-catchables.nix
@@ -0,0 +1 @@
+(builtins.tryEval (  builtins.baseNameOf (throw "jill") )).success