aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-inline.hh
diff options
context:
space:
mode:
authorGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-10-25 01:46:10 +0200
committerGuillaume Maudoux <guillaume.maudoux@tweag.io>2022-10-25 01:46:10 +0200
commite93bf69b448d4f4ce6c3fe7b7acfa904afe058c0 (patch)
tree902c6994294be36fe9ebd9c7e2149f9010776b82 /src/libexpr/eval-inline.hh
parent8bd8583bc7a430eeee0f5d5e5cb502158419a500 (diff)
Rework error throwing, and test it
Diffstat (limited to 'src/libexpr/eval-inline.hh')
-rw-r--r--src/libexpr/eval-inline.hh6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libexpr/eval-inline.hh b/src/libexpr/eval-inline.hh
index 279f5b8be..f0da688db 100644
--- a/src/libexpr/eval-inline.hh
+++ b/src/libexpr/eval-inline.hh
@@ -103,7 +103,7 @@ void EvalState::forceValue(Value & v, Callable getPos)
else if (v.isApp())
callFunction(*v.app.left, *v.app.right, v, noPos);
else if (v.isBlackhole())
- error<EvalError>("infinite recursion encountered").atPos(getPos()).debugThrow();
+ error("infinite recursion encountered").atPos(getPos()).template debugThrow<EvalError>();
}
@@ -121,7 +121,7 @@ inline void EvalState::forceAttrs(Value & v, Callable getPos, std::string_view e
forceValue(v, noPos);
if (v.type() != nAttrs) {
PosIdx pos = getPos();
- this->error<TypeError>("value is %1% while a set was expected", showType(v)).withTrace(pos, errorCtx).debugThrow();
+ error("value is %1% while a set was expected", showType(v)).withTrace(pos, errorCtx).debugThrow<TypeError>();
}
}
@@ -131,7 +131,7 @@ inline void EvalState::forceList(Value & v, const PosIdx pos, std::string_view e
{
forceValue(v, noPos);
if (!v.isList()) {
- this->error<TypeError>("value is %1% while a list was expected", showType(v)).withTrace(pos, errorCtx).debugThrow();
+ error("value is %1% while a list was expected", showType(v)).withTrace(pos, errorCtx).debugThrow<TypeError>();
}
}