diff options
author | Ben Burdette <bburdette@protonmail.com> | 2022-03-29 16:44:47 -0600 |
---|---|---|
committer | Ben Burdette <bburdette@protonmail.com> | 2022-03-29 16:44:47 -0600 |
commit | c0a567e1963faaf9b16f772d6b4e76496a88ed32 (patch) | |
tree | 97854b0732781dd30b4f039811e49b3a9f805d42 /src/libexpr/eval.cc | |
parent | 5ab7bdf0b14199da8423a8f2e433b2d6beef1e69 (diff) |
remove const_cast
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r-- | src/libexpr/eval.cc | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index f162f3e0b..cc0380d4a 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -937,7 +937,7 @@ LocalNoInlineNoReturn(void throwAssertionError(const Pos & pos, const char * s, throw error; } -LocalNoInlineNoReturn(void throwUndefinedVarError(const Pos & pos, const char * s, const string & s1, Env & env, Expr &expr)) +LocalNoInlineNoReturn(void throwUndefinedVarError(const Pos & pos, const char * s, const string & s1, Env & env, const Expr &expr)) { auto error = UndefinedVarError({ .msg = hintfmt(s, s1), @@ -1053,8 +1053,7 @@ inline Value * EvalState::lookupVar(Env * env, const ExprVar & var, bool noEval) return j->value; } if (!env->prevWith) { - // TODO deal with const_cast - throwUndefinedVarError(var.pos, "undefined variable '%1%'", var.name, *env, *const_cast<ExprVar*>(&var)); + throwUndefinedVarError(var.pos, "undefined variable '%1%'", var.name, *env, var); } for (size_t l = env->prevWith; l; --l, env = env->up) ; } |