From 4f5c6330c9f3df2533daf33ecaf0c52420979674 Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 1 May 2014 20:17:03 -0400 Subject: [PATCH] types.loaOf: Update check function This symplifies typechecking and allows properties to be used inside the function body. It also makes possible checking the type of the result. --- lib/types.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/types.nix b/lib/types.nix index a5b9d59e30ff..4d336c1d9466 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -159,10 +159,7 @@ in rec { attrOnly = attrsOf elemType; in mkOptionType { name = "list or attribute set of ${elemType.name}s"; - check = x: - if isList x then listOnly.check x - else if isAttrs x then attrOnly.check x - else false; + check = x: isList x || isAttrs x; merge = loc: defs: attrOnly.merge loc (imap convertIfList defs); getSubOptions = prefix: elemType.getSubOptions (prefix ++ [""]); getSubModules = elemType.getSubModules;