error message formatting

This commit is contained in:
Ben Burdette 2020-11-09 19:16:50 -07:00
parent 9f2b25ce55
commit d8ef423a18

View file

@ -1366,6 +1366,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res)
actualArgs->attrs->push_back(*j); actualArgs->attrs->push_back(*j);
} else if (!i.def) { } else if (!i.def) {
throwUndefinedVarError(i.pos, R"(cannot auto-call a function that has an argument without a default value ('%1%') throwUndefinedVarError(i.pos, R"(cannot auto-call a function that has an argument without a default value ('%1%')
An 'auto-call' is when a nix expression is evaluated without any external arguments. An 'auto-call' is when a nix expression is evaluated without any external arguments.
If that nix expression is a function, and that function's arguments all have default If that nix expression is a function, and that function's arguments all have default
values, then all is well. values, then all is well.
@ -1387,7 +1388,7 @@ void EvalState::autoCallFunction(Bindings & args, Value & fun, Value & res)
nixpkgs.stdenv.mkDerivation { nixpkgs.stdenv.mkDerivation {
... ...
See this nix pill for more information re callPackage format: More about callPackage:
https://nixos.org/guides/nix-pills/callpackage-design-pattern.html)", i.name); https://nixos.org/guides/nix-pills/callpackage-design-pattern.html)", i.name);
} }
} }