about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr')
-rw-r--r--third_party/nix/src/libexpr/primops.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/third_party/nix/src/libexpr/primops.cc b/third_party/nix/src/libexpr/primops.cc
index 49c43556fe9e..710d214ce7c2 100644
--- a/third_party/nix/src/libexpr/primops.cc
+++ b/third_party/nix/src/libexpr/primops.cc
@@ -1369,6 +1369,11 @@ static void prim_catAttrs(EvalState& state, const Pos& pos, Value** args,
 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) {
+    // TODO(sterni): return set of formal arguments for fetch* primops
+    state.mkAttrs(v, 0);
+    return;
+  }
   if (args[0]->type != tLambda) {
     throw TypeError(format("'functionArgs' requires a function, at %1%") % pos);
   }