aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/nixexpr.cc
diff options
context:
space:
mode:
authoreldritch horrors <pennae@lix.systems>2024-03-08 09:51:27 +0100
committereldritch horrors <pennae@lix.systems>2024-03-10 03:18:32 -0600
commit03f852b2c69233667de839a4777331114304c983 (patch)
tree1c4b3b1c695708b6d3ed8acaaa978d7f653b980b /src/libexpr/nixexpr.cc
parent3e43f4aeff2947aea98bb0d538fa686bd55a1385 (diff)
preserve information about whether/how an attribute was inherited
(cherry picked from commit c66ee57edc6cac3571bfbf77d0c0ea4d25b4e805) Change-Id: Ie8606a8b2f5946c87dd4d16b7b46203e199a4cc1
Diffstat (limited to 'src/libexpr/nixexpr.cc')
-rw-r--r--src/libexpr/nixexpr.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/nixexpr.cc b/src/libexpr/nixexpr.cc
index 3525ea1a3..a12fd62c0 100644
--- a/src/libexpr/nixexpr.cc
+++ b/src/libexpr/nixexpr.cc
@@ -80,7 +80,7 @@ void ExprAttrs::show(const SymbolTable & symbols, std::ostream & str) const
return sa < sb;
});
for (auto & i : sorted) {
- if (i->second.inherited)
+ if (i->second.inherited())
str << "inherit " << symbols[i->first] << " " << "; ";
else {
str << symbols[i->first] << " = ";
@@ -151,7 +151,7 @@ void ExprLet::show(const SymbolTable & symbols, std::ostream & str) const
{
str << "(let ";
for (auto & i : attrs->attrs)
- if (i.second.inherited) {
+ if (i.second.inherited()) {
str << "inherit " << symbols[i.first] << "; ";
}
else {
@@ -341,7 +341,7 @@ void ExprAttrs::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv>
// No need to sort newEnv since attrs is in sorted order.
for (auto & i : attrs)
- i.second.e->bindVars(es, i.second.inherited ? env : newEnv);
+ i.second.e->bindVars(es, i.second.inherited() ? env : newEnv);
for (auto & i : dynamicAttrs) {
i.nameExpr->bindVars(es, newEnv);
@@ -416,7 +416,7 @@ void ExprLet::bindVars(EvalState & es, const std::shared_ptr<const StaticEnv> &
// No need to sort newEnv since attrs->attrs is in sorted order.
for (auto & i : attrs->attrs)
- i.second.e->bindVars(es, i.second.inherited ? env : newEnv);
+ i.second.e->bindVars(es, i.second.inherited() ? env : newEnv);
if (es.debugRepl)
es.exprEnvs.insert(std::make_pair(this, newEnv));