aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops
diff options
context:
space:
mode:
authorKevin Amado <kamadorueda@gmail.com>2021-10-14 23:23:04 -0500
committerKevin Amado <kamadorueda@gmail.com>2021-10-14 23:23:05 -0500
commit1bdeef83958251e728abe9398b4286cb6b5e9551 (patch)
tree91f2d0cfa2499b0ffcf81d77d08c53741057c25c /src/libexpr/primops
parent4c0cde95ad8dc95f876e5cf32790e73e08f49b28 (diff)
add pos to EvalState::forceValue
- This way we improve error messages on infinite recursion - Demo: ```nix let x = builtins.fetchMercurial x; in x ``` - Before: ```bash $ nix-instantiate --show-trace --strict error: infinite recursion encountered ``` - After: ```bash nix-instantiate --show-trace --strict error: infinite recursion encountered at /data/github/kamadorueda/test/default.nix:2:7: 1| let 2| x = builtins.fetchMercurial x; | ^ 3| in ``` Mentions: #3505
Diffstat (limited to 'src/libexpr/primops')
-rw-r--r--src/libexpr/primops/fetchMercurial.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchMercurial.cc b/src/libexpr/primops/fetchMercurial.cc
index 1cd481243..c23480853 100644
--- a/src/libexpr/primops/fetchMercurial.cc
+++ b/src/libexpr/primops/fetchMercurial.cc
@@ -15,7 +15,7 @@ static void prim_fetchMercurial(EvalState & state, const Pos & pos, Value * * ar
std::string name = "source";
PathSet context;
- state.forceValue(*args[0]);
+ state.forceValue(*args[0], pos);
if (args[0]->type() == nAttrs) {