about summary refs log tree commit diff
path: root/tvix/eval/src
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src')
-rw-r--r--tvix/eval/src/builtins/mod.rs3
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix1
3 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs
index b7649e7995ed..d85d6567ea8a 100644
--- a/tvix/eval/src/builtins/mod.rs
+++ b/tvix/eval/src/builtins/mod.rs
@@ -931,6 +931,9 @@ mod pure_builtins {
 
     #[builtin("splitVersion")]
     async fn builtin_split_version(co: GenCo, s: Value) -> Result<Value, ErrorKind> {
+        if s.is_catchable() {
+            return Ok(s);
+        }
         let s = s.to_str()?;
         let s = VersionPartsIter::new(s.as_str());
 
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp
new file mode 100644
index 000000000000..c508d5366f70
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.exp
@@ -0,0 +1 @@
+false
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix
new file mode 100644
index 000000000000..0668ec7de2ef
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-splitversion-catchable.nix
@@ -0,0 +1 @@
+(builtins.tryEval (builtins.splitVersion (throw "fred"))).success