about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix
diff options
context:
space:
mode:
Diffstat (limited to 'tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix5
1 files changed, 5 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix
new file mode 100644
index 0000000000..7be6660009
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-closure-self.nix
@@ -0,0 +1,5 @@
+let
+  # self-recursive function should be able to close over itself
+  f = n: if n <= 0 then "done" else f (n - 1);
+in
+f 10