Merge pull request #4751 from Ma27/storepath-pos

primops/storePath: add trace to pure mode error
This commit is contained in:
Domen Kožar 2021-04-27 19:05:23 +02:00 committed by GitHub
commit e3e78ee2a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1251,7 +1251,10 @@ static RegisterPrimOp primop_toPath({
static void prim_storePath(EvalState & state, const Pos & pos, Value * * args, Value & v)
{
if (evalSettings.pureEval)
throw EvalError("builtins.storePath' is not allowed in pure evaluation mode");
throw EvalError({
.msg = hintfmt("'%s' is not allowed in pure evaluation mode", "builtins.storePath"),
.errPos = pos
});
PathSet context;
Path path = state.checkSourcePath(state.coerceToPath(pos, *args[0], context));