forceValue: make pos mandatory
- Make passing the position to `forceValue` mandatory, this way we remember people that the position is important for better error messages - Add pos to all `forceValue` calls
This commit is contained in:
@@ -53,7 +53,7 @@ void EvalState::forceValue(Value & v, const Pos & pos)
|
||||
|
||||
inline void EvalState::forceAttrs(Value & v)
|
||||
{
|
||||
forceValue(v);
|
||||
forceValue(v, v.determinePos(noPos));
|
||||
if (v.type() != nAttrs)
|
||||
throwTypeError("value is %1% while a set was expected", v);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ inline void EvalState::forceAttrs(Value & v, const Pos & pos)
|
||||
|
||||
inline void EvalState::forceList(Value & v)
|
||||
{
|
||||
forceValue(v);
|
||||
forceValue(v, v.determinePos(noPos));
|
||||
if (!v.isList())
|
||||
throwTypeError("value is %1% while a list was expected", v);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user