aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-09-25 15:14:18 +0200
committerGitHub <noreply@github.com>2020-09-25 15:14:18 +0200
commitcbb9862cd9008f7e34d9367b5a4fb520ee0ba351 (patch)
treea83eb589476314a56b22344cbaf06ca1e1d24420
parent7b2ae472ff05a39cd635ac10dbbce3cd17b60c93 (diff)
parentb2748c6e99239ff6803ba0da76c362790c8be192 (diff)
Merge pull request #3626 from W95Psp/master
Make `functionArgs` primitive accept primops (fix #3624)
-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 9cfe3f402..2b304aab0 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -2236,6 +2236,10 @@ static RegisterPrimOp primop_catAttrs({
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({
.hint = hintfmt("'functionArgs' requires a function"),