1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

pass Pos to forceValue to improve infinite recursion error

This commit is contained in:
Domen Kožar 2020-04-16 12:32:07 +02:00
parent 2f9789c2e6
commit b865b5b40c
No known key found for this signature in database
GPG key ID: C2FFBCAFD2C24246
3 changed files with 37 additions and 37 deletions

View file

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