diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 459d19e05..9741e3177 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -1056,7 +1056,8 @@ static void prim_warn(EvalState & state, const PosIdx pos, Value * * args, Value } if (evalSettings.builtinsAbortOnWarn) { - state.error("aborting to reveal stack trace of warning, as abort-on-warn is set").debugThrow(); + // Not an EvalError or subclass, which would cause the error to be stored in the eval cache. + state.error("aborting to reveal stack trace of warning, as abort-on-warn is set").debugThrow(); } if (evalSettings.builtinsTraceDebugger || evalSettings.builtinsDebuggerOnWarn) { state.runDebugRepl(nullptr);