diff options
author | Robin Gloster <mail@glob.in> | 2019-10-27T09·15+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-01-04T13·10+0100 |
commit | 3130aafd0145c5c07f4557fe37f0c4d367e2d4f1 (patch) | |
tree | e3a4d542172a258b6926e454251752fac46ae4d7 /src/libexpr/eval.hh | |
parent | 6c90e3b9ac7c99d2ec4366363e99b9740470e41c (diff) |
builtins.toJSON: fix __toString usage
(cherry picked from commit e583df52800b4baa1564b027fe3b83a21756c2cc)
Diffstat (limited to 'src/libexpr/eval.hh')
-rw-r--r-- | src/libexpr/eval.hh | 4 |
1 files changed, 4 insertions, 0 deletions
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 <map> +#include <optional> #include <unordered_map> @@ -196,6 +197,9 @@ public: set with attribute `type = "derivation"'). */ bool isDerivation(Value & v); + std::optional<string> 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, |