Skip to content

Commit 77f5f50

Browse files
committed
libexpr: Use context getter
1 parent c2aaa68 commit 77f5f50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libexpr/eval.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ std::string showType(const Value & v)
126126
#pragma GCC diagnostic push
127127
#pragma GCC diagnostic ignored "-Wswitch-enum"
128128
switch (v.internalType) {
129-
case tString: return v.payload.string.context ? "a string with context" : "a string";
129+
case tString: return v.context() ? "a string with context" : "a string";
130130
case tPrimOp:
131131
return fmt("the built-in function '%s'", std::string(v.primOp()->name));
132132
case tPrimOpApp:
@@ -2297,8 +2297,8 @@ std::string_view EvalState::forceString(Value & v, const PosIdx pos, std::string
22972297

22982298
void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings)
22992299
{
2300-
if (v.payload.string.context)
2301-
for (const char * * p = v.payload.string.context; *p; ++p)
2300+
if (v.context())
2301+
for (const char * * p = v.context(); *p; ++p)
23022302
context.insert(NixStringContextElem::parse(*p, xpSettings));
23032303
}
23042304

0 commit comments

Comments
 (0)