about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-09-29T20·58+0300
committerclbot <clbot@tvl.fyi>2022-10-03T07·50+0000
commit8336577c411004d27c86703c4a95e26d3cd762cc (patch)
treea4a7bcd242a2937cce549f117081d959f891afdb /tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix
parentc1d8cee215a3e5787d4bd5de91ce029307ac718a (diff)
feat(tvix/eval): implement tail-calling of __functor attributes r/5019
This implements __functor calling in situations where `OpTailCall` is
used, but not yet for `OpCall`.

For some reason I have not yet figured out, this same implementation
does not work in call_value, which means that it also doesn't yet work
in builtins that apply functions.

Change-Id: I378f9065ac53d4c05166a7d0151acb1f55c91579
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6826
Autosubmit: tazjin <tazjin@tvl.su>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix1
1 files changed, 1 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix
new file mode 100644
index 0000000000..80ae345d83
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix
@@ -0,0 +1 @@
+{ x = 21; __functor = self: y: self.x * y; } 2