forked from lix-project/lix
c34e96f7e0
This allows querying the location of function arguments. E.g. builtins.unsafeGetAttrPos "x" (builtins.functionArgs ({ x }: null)) => { column = 57; file = "/home/infinisil/src/nix/inst/test.nix"; line = 1; }
5 lines
156 B
Nix
5 lines
156 B
Nix
let
|
|
fun = { foo }: {};
|
|
pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun);
|
|
in { inherit (pos) column line; file = baseNameOf pos.file; }
|