forceBool(): Show position info

This commit is contained in:
Eelco Dolstra
2016-08-29 19:37:19 +02:00
parent 26d92017d3
commit c42d1acfeb
4 changed files with 14 additions and 13 deletions
+2 -2
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;
}