diff options
author | Kevin Amado <kamadorueda@gmail.com> | 2021-11-27 12:40:24 -0500 |
---|---|---|
committer | Kevin Amado <kamadorueda@gmail.com> | 2022-01-21 16:32:43 -0500 |
commit | 49b0bb020663b7283549754a826b1346c93a8bbb (patch) | |
tree | 6415237a41abb754bcc51d426f3a85cd4f5f28aa /src/nix | |
parent | 5f08db69d18ea5b868cbb58993822e7dd0307518 (diff) |
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
Diffstat (limited to 'src/nix')
-rw-r--r-- | src/nix/eval.cc | 2 | ||||
-rw-r--r-- | src/nix/repl.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/nix/eval.cc b/src/nix/eval.cc index c7517cf79..686244be0 100644 --- a/src/nix/eval.cc +++ b/src/nix/eval.cc @@ -81,7 +81,7 @@ struct CmdEval : MixJSON, InstallableCommand recurse = [&](Value & v, const Pos & pos, const Path & path) { - state->forceValue(v); + state->forceValue(v, pos); if (v.type() == nString) // FIXME: disallow strings with contexts? writeFile(path, v.string.s); diff --git a/src/nix/repl.cc b/src/nix/repl.cc index be9f96836..5c2bf4bfd 100644 --- a/src/nix/repl.cc +++ b/src/nix/repl.cc @@ -712,7 +712,7 @@ void NixRepl::evalString(string s, Value & v) { Expr * e = parseString(s); e->eval(*state, *env, v); - state->forceValue(v); + state->forceValue(v, v.determinePos(noPos)); } @@ -742,7 +742,7 @@ std::ostream & NixRepl::printValue(std::ostream & str, Value & v, unsigned int m str.flush(); checkInterrupt(); - state->forceValue(v); + state->forceValue(v, v.determinePos(noPos)); switch (v.type()) { |