diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 92516db3b..7346a7651 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -126,9 +126,9 @@ std::string showType(const Value & v) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wswitch-enum" switch (v.internalType) { - case tString: return v.payload.string.context ? "a string with context" : "a string"; + case tString: return v.context() ? "a string with context" : "a string"; case tPrimOp: - return fmt("the built-in function '%s'", std::string(v.payload.primOp->name)); + return fmt("the built-in function '%s'", std::string(v.primOp()->name)); case tPrimOpApp: return fmt("the partially applied built-in function '%s'", v.primOpAppPrimOp()->name); case tExternal: return v.external()->showType(); @@ -2297,8 +2297,8 @@ std::string_view EvalState::forceString(Value & v, const PosIdx pos, std::string void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings) { - if (v.payload.string.context) - for (const char * * p = v.payload.string.context; *p; ++p) + if (v.context()) + for (const char * * p = v.context(); *p; ++p) context.insert(NixStringContextElem::parse(*p, xpSettings)); } diff --git a/src/libexpr/include/nix/expr/symbol-table.hh b/src/libexpr/include/nix/expr/symbol-table.hh index 1bf5b5543..20a05a09d 100644 --- a/src/libexpr/include/nix/expr/symbol-table.hh +++ b/src/libexpr/include/nix/expr/symbol-table.hh @@ -29,7 +29,7 @@ class SymbolValue : protected Value public: operator std::string_view() const noexcept { - return {payload.string.c_str, size_}; + return {c_str(), size_}; } }; @@ -122,7 +122,7 @@ public: [[gnu::always_inline]] const char * c_str() const noexcept { - return s->payload.string.c_str; + return s->c_str(); } [[gnu::always_inline]]