| 2377 | } |
| 2378 | |
| 2379 | std::string_view EvalState::forceString(Value & v, const PosIdx pos, std::string_view errorCtx) |
| 2380 | { |
| 2381 | try { |
| 2382 | forceValue(v, pos); |
| 2383 | if (v.type() != nString) |
| 2384 | error<TypeError>( |
| 2385 | "expected a string but found %1%: %2%", showType(v), ValuePrinter(*this, v, errorPrintOptions)) |
| 2386 | .atPos(pos) |
| 2387 | .debugThrow(); |
| 2388 | return v.string_view(); |
| 2389 | } catch (Error & e) { |
| 2390 | e.addTrace(positions[pos], errorCtx); |
| 2391 | throw; |
| 2392 | } |
| 2393 | } |
| 2394 | |
| 2395 | void copyContext(const Value & v, NixStringContext & context, const ExperimentalFeatureSettings & xpSettings) |
| 2396 | { |
no test coverage detected