aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/lang
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-08 09:50:55 +0100
committereldritch horrors <pennae@lix.systems>2024-03-10 03:18:32 -0600
commit0c19e6b56c1adc02583487147c75dc520c5c3f1e (patch)
treeda391f7ccf640a822fd8e180359aeafda306bf2d /tests/functional/lang
parent7c882a507580853b13ce8c62ac7af94c76bc9125 (diff)
add test for inherit-from semantics
(cherry picked from commit 8669c02468994887be91072ac58b1ee43380d354) Change-Id: If8513316bf4b4b559c5bb63842c856f016816802
Diffstat (limited to 'tests/functional/lang')
-rw-r--r--tests/functional/lang/eval-okay-inherit-from.err.exp2
-rw-r--r--tests/functional/lang/eval-okay-inherit-from.exp1
-rw-r--r--tests/functional/lang/eval-okay-inherit-from.nix6
3 files changed, 9 insertions, 0 deletions
diff --git a/tests/functional/lang/eval-okay-inherit-from.err.exp b/tests/functional/lang/eval-okay-inherit-from.err.exp
new file mode 100644
index 000000000..51881205b
--- /dev/null
+++ b/tests/functional/lang/eval-okay-inherit-from.err.exp
@@ -0,0 +1,2 @@
+trace: used
+trace: used
diff --git a/tests/functional/lang/eval-okay-inherit-from.exp b/tests/functional/lang/eval-okay-inherit-from.exp
new file mode 100644
index 000000000..43bd0e899
--- /dev/null
+++ b/tests/functional/lang/eval-okay-inherit-from.exp
@@ -0,0 +1 @@
+[ 1 2 { __overrides = { y = { d = [ ]; }; }; c = [ ]; d = 4; x = { c = [ ]; }; y = «repeated»; } ]
diff --git a/tests/functional/lang/eval-okay-inherit-from.nix b/tests/functional/lang/eval-okay-inherit-from.nix
new file mode 100644
index 000000000..d1fad7d69
--- /dev/null
+++ b/tests/functional/lang/eval-okay-inherit-from.nix
@@ -0,0 +1,6 @@
+let
+ inherit (builtins.trace "used" { a = 1; b = 2; }) a b;
+ x.c = 3;
+ y.d = 4;
+in
+ [ a b rec { x.c = []; inherit (x) c; inherit (y) d; __overrides.y.d = []; } ]