about summary refs log tree commit diff
path: root/tvix/eval/src/tests
diff options
context:
space:
mode:
authorVincent Ambo <mail@tazj.in>2022-08-14T19·28+0300
committertazjin <tazjin@tvl.su>2022-08-31T22·10+0000
commitf173161f4c0fc754df2b6daeca302d3e65bbf77d (patch)
treee3504fda83f4950def7ea39f06f3d2014d4020e2 /tvix/eval/src/tests
parent8c1c9aee3cab52befe55d6f41e1c9acaef1b1843 (diff)
feat(tvix/eval): implement inherit in let expressions r/4549
Note that at this point recursive bindings do not yet work in either
attrsets or let, so inheriting from the same scope is generally not
possible yet.

Change-Id: I6ca820d04b8ded5c22fb7ea18e2ec203bcaa8e9c
Reviewed-on: https://cl.tvl.fyi/c/depot/+/6215
Reviewed-by: sterni <sternenseemann@systemli.org>
Reviewed-by: grfn <grfn@gws.fyi>
Tested-by: BuildkiteCI
Diffstat (limited to 'tvix/eval/src/tests')
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp1
-rw-r--r--tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix8
2 files changed, 9 insertions, 0 deletions
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp
new file mode 100644
index 000000000000..d00491fd7e5b
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.exp
@@ -0,0 +1 @@
+1
diff --git a/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix
new file mode 100644
index 000000000000..12eed10e13fc
--- /dev/null
+++ b/tvix/eval/src/tests/tvix_tests/eval-okay-let-inherit.nix
@@ -0,0 +1,8 @@
+let
+  set = {
+    a = 1;
+  };
+in
+  let
+    inherit (set) a;
+  in a