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:
parent
055ab1fc8d
commit
8a87521636
3 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue