mirror of
https://github.com/NixOS/nix
synced 2025-06-27 08:31:16 +02:00
C API: fix after rebase
This commit is contained in:
parent
6c231dcf68
commit
2349185c96
3 changed files with 10 additions and 7 deletions
|
@ -108,17 +108,21 @@ public:
|
|||
* Coerce the value to a string.
|
||||
*/
|
||||
virtual std::string coerceToString(
|
||||
const nix::Pos & pos, nix::NixStringContext & context, bool copyMore, bool copyToStore) const override
|
||||
nix::EvalState & state,
|
||||
const nix::PosIdx & pos,
|
||||
nix::NixStringContext & context,
|
||||
bool copyMore,
|
||||
bool copyToStore) const override
|
||||
{
|
||||
if (!desc.coerceToString) {
|
||||
return nix::ExternalValueBase::coerceToString(pos, context, copyMore, copyToStore);
|
||||
return nix::ExternalValueBase::coerceToString(state, pos, context, copyMore, copyToStore);
|
||||
}
|
||||
nix_string_context ctx{context};
|
||||
nix_string_return res{""};
|
||||
// todo: pos, errors
|
||||
desc.coerceToString(v, &ctx, copyMore, copyToStore, &res);
|
||||
if (res.str.empty()) {
|
||||
return nix::ExternalValueBase::coerceToString(pos, context, copyMore, copyToStore);
|
||||
return nix::ExternalValueBase::coerceToString(state, pos, context, copyMore, copyToStore);
|
||||
}
|
||||
return std::move(res.str);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue