aboutsummaryrefslogtreecommitdiff
path: root/lib/types.nix
diff options
context:
space:
mode:
authorSilvan Mosberger <contact@infinisil.com>2020-09-16 20:03:40 +0200
committerSilvan Mosberger <contact@infinisil.com>2020-09-21 17:13:06 +0200
commit2ff7c3e2e1982fd3db4f8f7725143f0645682a54 (patch)
tree5ddc41965fad7d741efa854a9bd5578ad230ccd9 /lib/types.nix
parent366a677dbbae7983df69c7ff8076d3e0bfb1d350 (diff)
lib/types: Remove unreachable if branch
The type's check function already ensured that it can't be passed non-lists
Diffstat (limited to '')
-rw-r--r--lib/types.nix18
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/types.nix b/lib/types.nix
index aae45366b8fb..77105740bc23 100644
--- a/lib/types.nix
+++ b/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;