1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-02 13:31:48 +02:00

* Refactoring to support domain checks.

This commit is contained in:
Eelco Dolstra 2006-07-24 15:16:03 +00:00
parent 9c3099d328
commit 57751fdb55
10 changed files with 36 additions and 29 deletions

View file

@ -121,12 +121,11 @@ static void getDerivations(EvalState & state, Expr e,
ATerm body, pos;
if (matchFunction(e, formals, body, pos)) {
for (ATermIterator i(formals); i; ++i) {
Expr name, def;
if (matchNoDefFormal(*i, name))
Expr name, def; ATerm values, def2;
if (!matchFormal(*i, name, values, def2)) abort();
if (!matchDefaultValue(def2, def))
throw TypeError(format("cannot auto-call a function that has an argument without a default value (`%1%')")
% aterm2String(name));
else if (!matchDefFormal(*i, name, def))
abort(); /* can't happen */
}
getDerivations(state,
makeCall(e, makeAttrs(ATermMap(0))),