mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-11 00:36:20 +02:00
ba81e871b2
Given flake: ```nix { description = "nix json error provenance"; inputs = {}; outputs = { self }: { jsonFunction = _: "function"; json = builtins.toJSON (_: "function"); }; } ``` - Before: ```console ❯ nix eval --json .#jsonFunction error: cannot convert a function to JSON ``` - After: ```console ❯ nix eval --json .#jsonFunction error: cannot convert a function to JSON at /nix/store/b7imf1c2j4jnkg3ys7fsfbj02s5j0i4f-source/testflake/flake.nix:4:5: 3| outputs = { self }: { 4| jsonFunction = _: "function"; | ^ 5| json = builtins.toJSON (_: "function"); ```
19 lines
390 B
C++
19 lines
390 B
C++
#pragma once
|
|
|
|
#include "nixexpr.hh"
|
|
#include "eval.hh"
|
|
|
|
#include <string>
|
|
#include <map>
|
|
|
|
namespace nix {
|
|
|
|
class JSONPlaceholder;
|
|
|
|
void printValueAsJSON(EvalState & state, bool strict,
|
|
Value & v, const Pos & pos, JSONPlaceholder & out, PathSet & context);
|
|
|
|
void printValueAsJSON(EvalState & state, bool strict,
|
|
Value & v, const Pos & pos, std::ostream & str, PathSet & context);
|
|
|
|
}
|