mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-26 12:53:59 +03:00
lib/types: Remove unreachable if branch
The type's check function already ensured that it can't be passed non-lists
This commit is contained in:
parent
366a677dbb
commit
2ff7c3e2e1
@ -299,16 +299,14 @@ rec {
|
||||
check = isList;
|
||||
merge = loc: defs:
|
||||
map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
|
||||
if isList def.value then
|
||||
imap1 (m: def':
|
||||
(mergeDefinitions
|
||||
(loc ++ ["[definition ${toString n}-entry ${toString m}]"])
|
||||
elemType
|
||||
[{ inherit (def) file; value = def'; }]
|
||||
).optionalValue
|
||||
) def.value
|
||||
else
|
||||
throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
|
||||
imap1 (m: def':
|
||||
(mergeDefinitions
|
||||
(loc ++ ["[definition ${toString n}-entry ${toString m}]"])
|
||||
elemType
|
||||
[{ inherit (def) file; value = def'; }]
|
||||
).optionalValue
|
||||
) def.value
|
||||
) defs)));
|
||||
emptyValue = { value = {}; };
|
||||
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
|
||||
getSubModules = elemType.getSubModules;
|
||||
|
Loading…
Reference in New Issue
Block a user