Add a primop unsafeGetAttrPos to return the position of an attribute
This commit is contained in:
parent
fc33fd86b7
commit
285df765b9
6 changed files with 44 additions and 6 deletions
6
tests/lang/eval-okay-getattrpos.nix
Normal file
6
tests/lang/eval-okay-getattrpos.nix
Normal file
|
@ -0,0 +1,6 @@
|
|||
let
|
||||
as = {
|
||||
foo = "bar";
|
||||
};
|
||||
pos = builtins.unsafeGetAttrPos "foo" as;
|
||||
in { inherit (pos) column line; file = baseNameOf pos.file; }
|
Loading…
Add table
Add a link
Reference in a new issue