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:
Silvan Mosberger 2020-09-16 20:03:40 +02:00
parent 366a677dbb
commit 2ff7c3e2e1
No known key found for this signature in database
GPG Key ID: E8F1E9EAD284E17D

View File

@ -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;