tvl-depot/third_party/nix/tests/lang/eval-okay-attrs5.nix
Vincent Ambo 7994fd1d54 Add 'third_party/nix/' from commit 'be66c7a6b24e3c3c6157fd37b86c7203d14acf10'
git-subtree-dir: third_party/nix
git-subtree-mainline: cf8cd640c1
git-subtree-split: be66c7a6b24e3c3c6157fd37b86c7203d14acf10
2020-05-17 15:52:38 +01:00

21 lines
407 B
Nix

with import ./lib.nix;
let
as = { x.y.z = 123; a.b.c = 456; };
bs = { f-o-o.bar = "foo"; };
or = x: y: x || y;
in
[ as.x.y.z
as.foo or "foo"
as.x.y.bla or as.a.b.c
as.a.b.c or as.x.y.z
as.x.y.bla or bs.f-o-o.bar or "xyzzy"
as.x.y.bla or bs.bar.foo or "xyzzy"
(123).bla or null.foo or "xyzzy"
# Backwards compatibility test.
(fold or [] [true false false])
]