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; }
4 lines
156 B
Nix
4 lines
156 B
Nix
let
|
|
fun = { foo }: {};
|
|
pos = builtins.unsafeGetAttrPos "foo" (builtins.functionArgs fun);
|
|
in { inherit (pos) column line; file = baseNameOf pos.file; }
|