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

forceBool(): Show position info

This commit is contained in:
Eelco Dolstra 2016-08-29 17:56:35 +02:00
parent 26d92017d3
commit c42d1acfeb
4 changed files with 14 additions and 13 deletions

View file

@ -1378,11 +1378,11 @@ NixFloat EvalState::forceFloat(Value & v, const Pos & pos)
}
bool EvalState::forceBool(Value & v)
bool EvalState::forceBool(Value & v, const Pos & pos)
{
forceValue(v);
if (v.type != tBool)
throwTypeError("value is %1% while a Boolean was expected", v);
throwTypeError("value is %1% while a Boolean was expected, at %2%", v, pos);
return v.boolean;
}