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:
parent
26d92017d3
commit
c42d1acfeb
4 changed files with 14 additions and 13 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue