mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 06:22:42 +01:00
Make functionArgs primitive accept primops
(cherry picked from commit b2748c6e99)
This commit is contained in:
parent
b98a50af30
commit
9f7a59af71
1 changed files with 4 additions and 0 deletions
|
|
@ -1350,6 +1350,10 @@ static void prim_catAttrs(EvalState & state, const Pos & pos, Value * * args, Va
|
|||
static void prim_functionArgs(EvalState & state, const Pos & pos, Value * * args, Value & v)
|
||||
{
|
||||
state.forceValue(*args[0]);
|
||||
if (args[0]->type == tPrimOpApp || args[0]->type == tPrimOp) {
|
||||
state.mkAttrs(v, 0);
|
||||
return;
|
||||
}
|
||||
if (args[0]->type != tLambda)
|
||||
throw TypeError(format("'functionArgs' requires a function, at %1%") % pos);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue