diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-09-25 15:14:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-25 15:14:18 +0200 |
commit | cbb9862cd9008f7e34d9367b5a4fb520ee0ba351 (patch) | |
tree | a83eb589476314a56b22344cbaf06ca1e1d24420 | |
parent | 7b2ae472ff05a39cd635ac10dbbce3cd17b60c93 (diff) | |
parent | b2748c6e99239ff6803ba0da76c362790c8be192 (diff) |
Merge pull request #3626 from W95Psp/master
Make `functionArgs` primitive accept primops (fix #3624)
-rw-r--r-- | src/libexpr/primops.cc | 4 |
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"), |