about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/eval-okay-closure-with-shadowing.nix
blob: 30546377521751e5b922131651284ec07957a1a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
# If a closure closes over a variable that is statically known *and*
# available dynamically through `with`, the statically known one must
# have precedence.

let
  # introduce statically known `a` (this should be the result)
  a = 1;
in

# introduce some closure depth to force both kinds of upvalue
# resolution, and introduce a dynamically known `a` within the
# closures
let f = b: with { a = 2; }; c: a + b + c;
in f 0 0