1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-08 02:43:54 +02:00

Merge pull request #4899 from sternenseemann/primops-2.3

[2.3] backport: Make `functionArgs` primitive accept primops
This commit is contained in:
Eelco Dolstra 2021-06-23 14:15:36 +02:00 committed by GitHub
commit 926163070b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);