mirror of
https://github.com/NixOS/nix
synced 2025-06-25 23:11:16 +02:00
C API: Require non-thunk value from primop definition
This commit is contained in:
parent
8884227045
commit
8ef6efc184
2 changed files with 50 additions and 0 deletions
|
@ -100,6 +100,15 @@ static void nix_c_primop_wrapper(
|
|||
.debugThrow();
|
||||
}
|
||||
|
||||
if (vTmp.type() == nix::nThunk) {
|
||||
// We might allow this in the future if it makes sense for the evaluator
|
||||
// e.g. implementing tail recursion by returning a thunk to the next
|
||||
// "iteration". Until then, this is most likely a mistake or misunderstanding.
|
||||
state.error<nix::EvalError>("Implementation error in custom function: return value must not be a thunk")
|
||||
.atPos(pos)
|
||||
.debugThrow();
|
||||
}
|
||||
|
||||
v = vTmp;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue