mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-10-02 21:10:08 +00:00
lib.modules: inline head defs variable
Each value passed to a function or primop is passed as a thunk, so `head defs` will only be evaluated twice if we're throwing an error. Validated with `builtins.trace`.
This commit is contained in:
@@ -1193,11 +1193,8 @@ let
|
||||
# original singleton straight to the type merge.
|
||||
if
|
||||
length defs == 1
|
||||
&& (
|
||||
let
|
||||
d = head defs;
|
||||
in
|
||||
addErrorContext "while evaluating definitions from `${d.file}':" (!d.value ? _type)
|
||||
&& addErrorContext "while evaluating definitions from `${(head defs).file}':" (
|
||||
!(head defs).value ? _type
|
||||
)
|
||||
then
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user