From 3130aafd0145c5c07f4557fe37f0c4d367e2d4f1 Mon Sep 17 00:00:00 2001 From: Robin Gloster Date: Sun, 27 Oct 2019 10:15:51 +0100 Subject: builtins.toJSON: fix __toString usage (cherry picked from commit e583df52800b4baa1564b027fe3b83a21756c2cc) --- src/libexpr/eval.hh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libexpr/eval.hh') diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh index 22472fd726b2..61ee4a73b563 100644 --- a/src/libexpr/eval.hh +++ b/src/libexpr/eval.hh @@ -9,6 +9,7 @@ #include "function-trace.hh" #include +#include #include @@ -196,6 +197,9 @@ public: set with attribute `type = "derivation"'). */ bool isDerivation(Value & v); + std::optional tryAttrsToString(const Pos & pos, Value & v, + PathSet & context, bool coerceMore = false, bool copyToStore = true); + /* String coercion. Converts strings, paths and derivations to a string. If `coerceMore' is set, also converts nulls, integers, booleans and lists to a string. If `copyToStore' is set, -- cgit 1.4.1