about summary refs log tree commit diff
path: root/tvix/eval/src/tests/tvix_tests/notyetpassing/eval-okay-builtins-set-pointer-equality.nix
blob: aa2a0a1e198ffb36685b5c64c49e05d51950dfea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
let
  alias = builtins;
in

[
  (builtins == builtins)
  (alias == builtins)
  (builtins == builtins.builtins)
  (builtins.builtins == builtins.builtins)
  (builtins.builtins == builtins.builtins.builtins)
  (alias == alias)
  (alias == builtins.builtins)
  ([ builtins ] == [ builtins ])

  # Surprisingly the following expressions don't work. They are
  # here for documentation purposes and covered only
  # by eval-okay-select-pointer-inequality.nix. Reasoning is that
  # we may not want / be able to replicate this behavior at all.
  #   ([ builtins.add ] == [ builtins.add ])
  #   ({ inherit (builtins) import; } == { inherit (builtins) import; })

  # These expressions work as expected, however:
  (let x = { inherit (builtins) add; }; in x == x)
  (let inherit (builtins) add; in [ add ] == [ add ])
]