1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00
This commit is contained in:
Timofey 2025-11-08 12:29:34 +03:00 committed by GitHub
commit 099c6d426b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 1 deletions

View file

@ -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 * vName = Value::toPtr(state.symbols[i.name]);
Value * vFun2 = state.allocValue(); Value * vFun2 = state.allocValue();
vFun2->mkApp(args[0], vName); 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()); v.mkAttrs(attrs.alreadySorted());

View file

@ -0,0 +1 @@
{ column = 5; file = "/pwd/lang/eval-okay-getattrpos-mapattrs.nix"; line = 3; }

View file

@ -0,0 +1,7 @@
let
attrs = {
a = { };
};
mappedAttrs = builtins.mapAttrs (key: value: value) attrs;
in builtins.unsafeGetAttrPos "a" mappedAttrs