aboutsummaryrefslogtreecommitdiff
path: root/tests/lang/eval-okay-listToAttrs.nix
blob: f5eae92ccd981622fe7bc23b7652fefb419426cc (plain)
1
2
3
4
5
6
7
8
# this test shows how to use listToAttrs and that evaluation is still lazy (throw isn't called)
let 
  asi = attr: value : { inherit attr value; };
  list = [ ( asi "a" "A" ) ( asi "b" "B" ) ];
  a = builtins.listToAttrs list;
  b = builtins.listToAttrs ( list ++ list );
  r = builtins.listToAttrs [ (asi "result" [ a b ]) ( asi "throw" (throw "this should not be thrown")) ];
in r.result