aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Franceschino <lucas.franceschino@inria.fr>2020-05-25 19:07:38 +0200
committerLucas Franceschino <lucas.franceschino@inria.fr>2020-05-25 19:07:38 +0200
commitb2748c6e99239ff6803ba0da76c362790c8be192 (patch)
treeb39d4fe5c451443f062d3fa997f9f77c06c7973d
parent81a0731e05805e92355738685fcc2c4fd74368a2 (diff)
Make `functionArgs` primitive accept primops
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 0a4236da4..5875457ac 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -1346,6 +1346,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], pos);
+ 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);