mirror of
https://github.com/NixOS/nix
synced 2025-06-28 01:11:15 +02:00
Print value on type error
Adds the failing value to `value is <TYPE> while a <TYPE> is expected` error messages.
This commit is contained in:
parent
b74ec56da9
commit
cb7fbd4d83
19 changed files with 227 additions and 136 deletions
|
@ -7,6 +7,7 @@
|
|||
#include "store-api.hh"
|
||||
#include "terminal.hh"
|
||||
#include "english.hh"
|
||||
#include "eval.hh"
|
||||
|
||||
namespace nix {
|
||||
|
||||
|
@ -501,4 +502,10 @@ void printValue(EvalState & state, std::ostream & output, Value & v, PrintOption
|
|||
Printer(output, state, options).print(v);
|
||||
}
|
||||
|
||||
std::ostream & operator<<(std::ostream & output, const ValuePrinter & printer)
|
||||
{
|
||||
printValue(printer.state, output, printer.value, printer.options);
|
||||
return output;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue