lib/types: Remove unreachable if branch

The type's check function already ensured that it can't be passed
non-lists
wip/yesman
Silvan Mosberger 4 years ago
parent 366a677dbb
commit 2ff7c3e2e1
No known key found for this signature in database
GPG Key ID: E8F1E9EAD284E17D
  1. 18
      lib/types.nix

@ -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…
Cancel
Save