From b37f5ae31dc0a0cbfa7e5bbf6b199e7e39c287ac Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Tue, 17 Apr 2018 14:33:12 -0400 Subject: isFunction: True on primops. Fixes #2073 --- src/libexpr/primops.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 9e7651da7..57dc7bd12 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); } -- cgit v1.2.3