Describe the bug
functionArgs is not considering primps or primops applications as functions, and throws an uncatchable error.
Steps To Reproduce
For instance, lib.functionArgs map reduces to an error.
Expected behavior
functionArgs should return {}
nix-env --version output
nix-env (Nix) 2.3.4
Additional context
I guess this is just about adding an if statement there to handle primops:
|
static void prim_functionArgs(EvalState & state, const Pos & pos, Value * * args, Value & v) |
|
{ |
|
state.forceValue(*args[0], pos); |
|
if (args[0]->type != tLambda) |
|
throw TypeError(format("'functionArgs' requires a function, at %1%") % pos); |
I'll post a PR, then.
Describe the bug
functionArgsis not considering primps or primops applications as functions, and throws an uncatchable error.Steps To Reproduce
For instance,
lib.functionArgs mapreduces to an error.Expected behavior
functionArgsshould return{}nix-env --versionoutputnix-env (Nix) 2.3.4Additional context
I guess this is just about adding an if statement there to handle primops:
nix/src/libexpr/primops.cc
Lines 1346 to 1350 in 25ed842
I'll post a PR, then.