diff options
author | Shea Levy <shea@shealevy.com> | 2018-04-17 14:33:12 -0400 |
---|---|---|
committer | Shea Levy <shea@shealevy.com> | 2018-04-17 14:33:12 -0400 |
commit | b37f5ae31dc0a0cbfa7e5bbf6b199e7e39c287ac (patch) | |
tree | f290f4d0a93081b7d67ed66d2e5986234fe1c06e /src/libexpr | |
parent | a4aac7f88c59c97299027c9668461c637bbc6a72 (diff) |
isFunction: True on primops.
Fixes #2073
Diffstat (limited to 'src/libexpr')
-rw-r--r-- | src/libexpr/primops.cc | 13 |
1 files changed, 12 insertions, 1 deletions
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); } |