aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ameen <alex.ameen.tx@gmail.com>2022-11-30 22:53:41 -0600
committerAlex Ameen <alex.ameen.tx@gmail.com>2022-11-30 22:53:41 -0600
commitad467265466dbccc816f550def9455ee720c5d3d (patch)
tree89c381a3a2da5171956c6b9f09fe256a89378e6d
parent16b03f03af2cbd2b8a682d737371c3194096d5e6 (diff)
doc: listToAttrs: document repeated keys
-rw-r--r--src/libexpr/primops.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 05265411c..3572ca181 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -2420,12 +2420,15 @@ static RegisterPrimOp primop_listToAttrs({
Construct a set from a list specifying the names and values of each
attribute. Each element of the list should be a set consisting of a
string-valued attribute `name` specifying the name of the attribute,
- and an attribute `value` specifying its value. Example:
+ and an attribute `value` specifying its value.
+ In case of duplicate occurrences of the same name, the first
+ takes precedence. Example:
```nix
builtins.listToAttrs
[ { name = "foo"; value = 123; }
{ name = "bar"; value = 456; }
+ { name = "bar"; value = 420; }
]
```