mirror of
https://github.com/NixOS/nix.git
synced 2024-11-23 07:12:27 +00:00
In checkOverlay, accept underscored names for final/prev args.
Resolves #4416.
This commit is contained in:
parent
133905b309
commit
3f070cc417
@ -346,10 +346,14 @@ struct CmdFlakeCheck : FlakeCommand
|
||||
auto checkOverlay = [&](const std::string & attrPath, Value & v, const Pos & pos) {
|
||||
try {
|
||||
state->forceValue(v, pos);
|
||||
if (!v.isLambda() || v.lambda.fun->hasFormals() || std::string(v.lambda.fun->arg) != "final")
|
||||
if (!v.isLambda() || v.lambda.fun->hasFormals() ||
|
||||
(std::string(v.lambda.fun->arg) != "final" &&
|
||||
std::string(v.lambda.fun->arg) != "_final"))
|
||||
throw Error("overlay does not take an argument named 'final'");
|
||||
auto body = dynamic_cast<ExprLambda *>(v.lambda.fun->body);
|
||||
if (!body || body->hasFormals() || std::string(body->arg) != "prev")
|
||||
if (!body || body->hasFormals() ||
|
||||
(std::string(body->arg) != "prev" &&
|
||||
std::string(body->arg) != "_prev"))
|
||||
throw Error("overlay does not take an argument named 'prev'");
|
||||
// FIXME: if we have a 'nixpkgs' input, use it to
|
||||
// evaluate the overlay.
|
||||
|
Loading…
Reference in New Issue
Block a user