mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
use singleton expr to generate black hole errors
this also reduces forceValue code size and removes the need for hideInDiagnostics. coopting thunk forcing like this has the additional benefit of clarifying how these errors can happen in the first place.
This commit is contained in:
parent
f9db4de0f3
commit
2b0e95e7aa
8 changed files with 51 additions and 61 deletions
|
@ -77,14 +77,6 @@ struct PrimOp
|
|||
*/
|
||||
std::optional<ExperimentalFeature> experimentalFeature;
|
||||
|
||||
/**
|
||||
* Whether to hide this primop in diagnostics.
|
||||
*
|
||||
* Used to hide the fact that black holes are primop applications from
|
||||
* stack traces.
|
||||
*/
|
||||
bool hideInDiagnostics;
|
||||
|
||||
/**
|
||||
* Validity check to be performed by functions that introduce primops,
|
||||
* such as RegisterPrimOp() and Value::mkPrimOp().
|
||||
|
@ -473,6 +465,8 @@ public:
|
|||
*/
|
||||
inline void forceValue(Value & v, const PosIdx pos);
|
||||
|
||||
void tryFixupBlackHolePos(Value & v, PosIdx pos);
|
||||
|
||||
/**
|
||||
* Force a value, then recursively force list elements and
|
||||
* attributes.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue