diff options
Diffstat (limited to 'src/libexpr/get-drvs.cc')
-rw-r--r-- | src/libexpr/get-drvs.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/libexpr/get-drvs.cc b/src/libexpr/get-drvs.cc index 82e34f776beb..05b4897cf75f 100644 --- a/src/libexpr/get-drvs.cc +++ b/src/libexpr/get-drvs.cc @@ -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))), |