mirror of
https://github.com/NixOS/nix
synced 2025-06-28 22:01:15 +02:00
forceAttrs: make pos mandatory
This commit is contained in:
parent
1472e045a7
commit
c3896e19d0
8 changed files with 13 additions and 12 deletions
|
@ -336,7 +336,7 @@ Value & AttrCursor::getValue()
|
|||
if (!_value) {
|
||||
if (parent) {
|
||||
auto & vParent = parent->first->getValue();
|
||||
root->state.forceAttrs(vParent);
|
||||
root->state.forceAttrs(vParent, vParent.determinePos(noPos));
|
||||
auto attr = vParent.attrs->get(parent->second);
|
||||
if (!attr)
|
||||
throw Error("attribute '%s' is unexpectedly missing", getAttrPathStr());
|
||||
|
|
|
@ -1132,7 +1132,7 @@ void ExprAttrs::eval(EvalState & state, Env & env, Value & v)
|
|||
Hence we need __overrides.) */
|
||||
if (hasOverrides) {
|
||||
Value * vOverrides = (*v.attrs)[overrides->second.displ].value;
|
||||
state.forceAttrs(*vOverrides);
|
||||
state.forceAttrs(*vOverrides, vOverrides->determinePos(noPos));
|
||||
Bindings * newBnds = state.allocBindings(v.attrs->capacity() + vOverrides->attrs->size());
|
||||
for (auto & i : *v.attrs)
|
||||
newBnds->push_back(i);
|
||||
|
|
|
@ -107,7 +107,7 @@ DrvInfo::Outputs DrvInfo::queryOutputs(bool onlyOutputsToInstall)
|
|||
string name = state->forceStringNoCtx(*elem, *i->pos);
|
||||
Bindings::iterator out = attrs->find(state->symbols.create(name));
|
||||
if (out == attrs->end()) continue; // FIXME: throw error?
|
||||
state->forceAttrs(*out->value);
|
||||
state->forceAttrs(*out->value, *i->pos);
|
||||
|
||||
/* And evaluate its ‘outPath’ attribute. */
|
||||
Bindings::iterator outPath = out->value->attrs->find(state->sOutPath);
|
||||
|
|
|
@ -214,7 +214,7 @@ static void import(EvalState & state, const Pos & pos, Value & vPath, Value * vS
|
|||
if (!vScope)
|
||||
state.evalFile(path, v);
|
||||
else {
|
||||
state.forceAttrs(*vScope);
|
||||
state.forceAttrs(*vScope, pos);
|
||||
|
||||
Env * env = &state.allocEnv(vScope->attrs->size());
|
||||
env->up = &state.baseEnv;
|
||||
|
@ -2485,7 +2485,7 @@ static void prim_zipAttrsWith(EvalState & state, const Pos & pos, Value * * args
|
|||
for (unsigned int n = 0; n < listSize; ++n) {
|
||||
Value * vElem = listElems[n];
|
||||
try {
|
||||
state.forceAttrs(*vElem);
|
||||
state.forceAttrs(*vElem, noPos);
|
||||
for (auto & attr : *vElem->attrs)
|
||||
attrsSeen[attr.name].first++;
|
||||
} catch (TypeError & e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue