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
1 changed files with 8 additions and 10 deletions

View File

@ -299,7 +299,6 @@ rec {
check = isList; check = isList;
merge = loc: defs: merge = loc: defs:
map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def: map (x: x.value) (filter (x: x ? value) (concatLists (imap1 (n: def:
if isList def.value then
imap1 (m: def': imap1 (m: def':
(mergeDefinitions (mergeDefinitions
(loc ++ ["[definition ${toString n}-entry ${toString m}]"]) (loc ++ ["[definition ${toString n}-entry ${toString m}]"])
@ -307,8 +306,7 @@ rec {
[{ inherit (def) file; value = def'; }] [{ inherit (def) file; value = def'; }]
).optionalValue ).optionalValue
) def.value ) def.value
else ) defs)));
throw "The option value `${showOption loc}` in `${def.file}` is not a list.") defs)));
emptyValue = { value = {}; }; emptyValue = { value = {}; };
getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]); getSubOptions = prefix: elemType.getSubOptions (prefix ++ ["*"]);
getSubModules = elemType.getSubModules; getSubModules = elemType.getSubModules;