1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 23:11:16 +02:00

forceAttrs: Show position info

This commit is contained in:
Eelco Dolstra 2014-04-04 19:11:40 +02:00
parent 96b695ccab
commit 27b44b8cf7
5 changed files with 23 additions and 14 deletions

View file

@ -55,6 +55,14 @@ inline void EvalState::forceAttrs(Value & v)
}
inline void EvalState::forceAttrs(Value & v, const Pos & pos)
{
forceValue(v);
if (v.type != tAttrs)
throwTypeError("value is %1% while a set was expected, at %2%", v, pos);
}
inline void EvalState::forceList(Value & v)
{
forceValue(v);