diff options
author | Adam Joseph <adam@westernsemico.com> | 2023-12-12T12·33-0800 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2023-12-12T17·51+0000 |
commit | 243a4b569909be678e0ddfcc1c66c62ff3ddb487 (patch) | |
tree | 57c7b4e7a6784f955c382c10000641037cd34c33 /tvix/eval/src/builtins/mod.rs | |
parent | c5f58d4af3eb47e6474a8793973889eca05f7978 (diff) |
fix(tvix/eval): substring: propagate catchables r/7205
Change-Id: Ia9b7858c817fbc9c95a3d1c2855b2445f7830e8d Reviewed-on: https://cl.tvl.fyi/c/depot/+/10326 Tested-by: BuildkiteCI Autosubmit: Adam Joseph <adam@westernsemico.com> Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/src/builtins/mod.rs')
-rw-r--r-- | tvix/eval/src/builtins/mod.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tvix/eval/src/builtins/mod.rs b/tvix/eval/src/builtins/mod.rs index 554fc9d7e329..27b7d5648f48 100644 --- a/tvix/eval/src/builtins/mod.rs +++ b/tvix/eval/src/builtins/mod.rs @@ -1002,10 +1002,11 @@ mod pure_builtins { let beg = start.as_int()?; let len = len.as_int()?; let span = generators::request_span(&co).await; - let x = s - .coerce_to_string(co, CoercionKind::Weak, span) - .await? - .to_str()?; + let x = s.coerce_to_string(co, CoercionKind::Weak, span).await?; + if x.is_catchable() { + return Ok(x); + } + let x = x.to_str()?; if beg < 0 { return Err(ErrorKind::IndexOutOfBounds { index: beg }); |