about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2018-04-17T18·33-0400
committerShea Levy <shea@shealevy.com>2018-04-17T18·33-0400
commitb37f5ae31dc0a0cbfa7e5bbf6b199e7e39c287ac (patch)
treef290f4d0a93081b7d67ed66d2e5986234fe1c06e /src/libexpr/primops.cc
parenta4aac7f88c59c97299027c9668461c637bbc6a72 (diff)
isFunction: True on primops.
Fixes #2073
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 9e7651da725f..57dc7bd1279d 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -271,7 +271,18 @@ static void prim_isNull(EvalState & state, const Pos & pos, Value * * args, Valu
 static void prim_isFunction(EvalState & state, const Pos & pos, Value * * args, Value & v)
 {
     state.forceValue(*args[0]);
-    mkBool(v, args[0]->type == tLambda);
+    bool res;
+    switch (args[0]->type) {
+        case tLambda:
+        case tPrimOp:
+        case tPrimOpApp:
+            res = true;
+            break;
+        default:
+            res = false;
+            break;
+    }
+    mkBool(v, res);
 }