about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-useless-inherit-with.nix
blob: d335e5363000cc1af2eb430170c68889bbda1e6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Normally using an `inherit` without a source attribute set within a
# `let` is a no-op, *unless* there is a with in-scope that might
# provide the value.

# Provide a dynamic `x` identifier in the scope.
with ({ x = 1;});

# inherit this `x` as a static identifier
let inherit x;

# Provide another dynamic `x` identifier
in with ({ x = 3; });

# Inherited static identifier should have precedence
x