diff options
author | Vincent Ambo <mail@tazj.in> | 2023-03-17T18·51+0300 |
---|---|---|
committer | tazjin <tazjin@tvl.su> | 2023-03-17T19·17+0000 |
commit | b78ae941a48bc7105ac964701a9e2c268b12d2ef (patch) | |
tree | ae4461992cbaecc7c8ee97adbac6e95b495e2dfa /tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix | |
parent | 68d287fd82fb18d902d112417395501b33b66699 (diff) |
fix(tvix/eval): use coerce_to_string in builtins.substring r/6022
This actually uses coercion under the hood in C++ Nix. See the test for an example. Change-Id: Id56b364acf269225b6829d0b600e0222f8b3608d Reviewed-on: https://cl.tvl.fyi/c/depot/+/8322 Reviewed-by: andi <andi@notmuch.email> Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix')
-rw-r--r-- | tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix new file mode 100644 index 000000000000..626ae1d1be55 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-builtins-substring-coerce.nix @@ -0,0 +1,5 @@ +# builtins.substring uses string coercion internally + +builtins.substring 0 2 { + __toString = _: "4200"; +} |