From bd9b1d97b42f307c8b595bb2de9b15bec1405b23 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 4 Apr 2014 22:19:33 +0200 Subject: Show position info in string concatenation / addition errors --- src/nix-env/user-env.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/nix-env/user-env.cc') diff --git a/src/nix-env/user-env.cc b/src/nix-env/user-env.cc index a95c4cba937f..e71ad34edbc5 100644 --- a/src/nix-env/user-env.cc +++ b/src/nix-env/user-env.cc @@ -121,8 +121,10 @@ bool createUserEnv(EvalState & state, DrvInfos & elems, debug("evaluating user environment builder"); state.forceValue(topLevel); PathSet context; - Path topLevelDrv = state.coerceToPath(*topLevel.attrs->find(state.sDrvPath)->value, context); - Path topLevelOut = state.coerceToPath(*topLevel.attrs->find(state.sOutPath)->value, context); + Attr & aDrvPath(*topLevel.attrs->find(state.sDrvPath)); + Path topLevelDrv = state.coerceToPath(aDrvPath.pos ? *(aDrvPath.pos) : noPos, *(aDrvPath.value), context); + Attr & aOutPath(*topLevel.attrs->find(state.sOutPath)); + Path topLevelOut = state.coerceToPath(aOutPath.pos ? *(aOutPath.pos) : noPos, *(aOutPath.value), context); /* Realise the resulting store expression. */ debug("building user environment"); -- cgit 1.4.1