1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 19:01:16 +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

@ -78,5 +78,15 @@ inline void EvalState::forceList(Value & v, const Pos & pos)
throwTypeError("value is %1% while a list was expected, at %2%", v, pos);
}
inline bool EvalState::isFunctor(Value& fun)
{
if (fun.type == tAttrs) {
auto found = fun.attrs->find(sFunctor);
if (found != fun.attrs->end()) {
return true;
}
}
return false;
}
}