1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 11:41:15 +02:00

forceFunction: allow functors as well

This commit is contained in:
Mathnerd314 2015-09-06 17:03:23 -06:00 committed by Eelco Dolstra
parent 055ab1fc8d
commit 8a87521636
3 changed files with 13 additions and 1 deletions

View file

@ -1294,7 +1294,7 @@ bool EvalState::forceBool(Value & v)
void EvalState::forceFunction(Value & v, const Pos & pos)
{
forceValue(v);
if (v.type != tLambda && v.type != tPrimOp && v.type != tPrimOpApp)
if (v.type != tLambda && v.type != tPrimOp && v.type != tPrimOpApp && !isFunctor(v))
throwTypeError("value is %1% while a function was expected, at %2%", v, pos);
}