From 8336577c411004d27c86703c4a95e26d3cd762cc Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 29 Sep 2022 23:58:53 +0300 Subject: feat(tvix/eval): implement tail-calling of __functor attributes 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 Reviewed-by: sterni Tested-by: BuildkiteCI --- tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.exp | 1 + tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix | 1 + 2 files changed, 2 insertions(+) create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.exp create mode 100644 tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.nix (limited to 'tvix/eval/src/tests') diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.exp new file mode 100644 index 000000000000..d81cc0710eb6 --- /dev/null +++ b/tvix/eval/src/tests/tvix_tests/eval-okay-functor-call.exp @@ -0,0 +1 @@ +42 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 000000000000..80ae345d836b --- /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 -- cgit 1.4.1