mirror of
https://github.com/NixOS/nix
synced 2025-06-26 07:31:15 +02:00
forceInt: Show position info
This commit is contained in:
parent
c28de6d96e
commit
b62d36963c
3 changed files with 11 additions and 11 deletions
|
@ -1151,11 +1151,11 @@ void EvalState::strictForceValue(Value & v)
|
|||
}
|
||||
|
||||
|
||||
NixInt EvalState::forceInt(Value & v)
|
||||
NixInt EvalState::forceInt(Value & v, const Pos & pos)
|
||||
{
|
||||
forceValue(v);
|
||||
if (v.type != tInt)
|
||||
throwTypeError("value is %1% while an integer was expected", v);
|
||||
throwTypeError("value is %1% while an integer was expected, at %2%", v, pos);
|
||||
return v.integer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue