diff options
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index b8c623b1a444..350a4fbe141f 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -540,8 +540,9 @@ void EvalState::eval(Expr * e, Value & v) } -inline bool EvalState::evalBool(Env & env, Expr * e, Value & v) +inline bool EvalState::evalBool(Env & env, Expr * e) { + Value v; e->eval(*this, env, v); if (v.type != tBool) throwTypeError("value is %1% while a Boolean was expected", v); @@ -549,13 +550,6 @@ inline bool EvalState::evalBool(Env & env, Expr * e, Value & v) } -inline bool EvalState::evalBool(Env & env, Expr * e) -{ - Value v; - return evalBool(env, e, v); -} - - inline void EvalState::evalAttrs(Env & env, Expr * e, Value & v) { e->eval(*this, env, v); @@ -945,13 +939,13 @@ void ExprWith::eval(EvalState & state, Env & env, Value & v) void ExprIf::eval(EvalState & state, Env & env, Value & v) { - (state.evalBool(env, cond, v) ? then : else_)->eval(state, env, v); + (state.evalBool(env, cond) ? then : else_)->eval(state, env, v); } void ExprAssert::eval(EvalState & state, Env & env, Value & v) { - if (!state.evalBool(env, cond, v)) + if (!state.evalBool(env, cond)) throwAssertionError("assertion failed at %1%", pos); body->eval(state, env, v); } |