mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 03:56:01 +01:00
Merge 4824837685 into 479b6b73a9
This commit is contained in:
commit
099c6d426b
3 changed files with 9 additions and 1 deletions
|
|
@ -3455,7 +3455,7 @@ static void prim_mapAttrs(EvalState & state, const PosIdx pos, Value ** args, Va
|
|||
Value * vName = Value::toPtr(state.symbols[i.name]);
|
||||
Value * vFun2 = state.allocValue();
|
||||
vFun2->mkApp(args[0], vName);
|
||||
attrs.alloc(i.name).mkApp(vFun2, i.value);
|
||||
attrs.alloc(i.name, i.pos).mkApp(vFun2, i.value);
|
||||
}
|
||||
|
||||
v.mkAttrs(attrs.alreadySorted());
|
||||
|
|
|
|||
1
tests/functional/lang/eval-okay-getattrpos-mapattrs.exp
Normal file
1
tests/functional/lang/eval-okay-getattrpos-mapattrs.exp
Normal file
|
|
@ -0,0 +1 @@
|
|||
{ column = 5; file = "/pwd/lang/eval-okay-getattrpos-mapattrs.nix"; line = 3; }
|
||||
7
tests/functional/lang/eval-okay-getattrpos-mapattrs.nix
Normal file
7
tests/functional/lang/eval-okay-getattrpos-mapattrs.nix
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
let
|
||||
attrs = {
|
||||
a = { };
|
||||
};
|
||||
|
||||
mappedAttrs = builtins.mapAttrs (key: value: value) attrs;
|
||||
in builtins.unsafeGetAttrPos "a" mappedAttrs
|
||||
Loading…
Add table
Add a link
Reference in a new issue