diff options
author | Silvan Mosberger <infinisil@icloud.com> | 2018-03-09 13:41:55 +0100 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2018-05-06 23:58:36 +0200 |
commit | ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975 (patch) | |
tree | 746af10a518ac39134299be845bb5a205cd4a30c /lib/types.nix | |
parent | 85b5fc7c9854d5b147fca2399d8ca6c3412afa2f (diff) | |
download | nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar.gz nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar.bz2 nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar.lz nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar.xz nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.tar.zst nixpkgs-ef8996f15ea2dd5aace0f61f9ab03f3dfa3d4975.zip |
lib/types: Fix coercedTo check
Without this change (coercedTo str toInt int).check "foo" would evaluate to true, even though (coercedTo str toInt int).merge {} [{ value = "foo"; }] will throw an error because "foo" can't be coerced to an int.
Diffstat (limited to 'lib/types.nix')
-rw-r--r-- | lib/types.nix | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/types.nix b/lib/types.nix index a334db5c724..45b0ae5042c 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -420,7 +420,7 @@ rec { mkOptionType rec { name = "coercedTo"; description = "${finalType.description} or ${coercedType.description}"; - check = x: finalType.check x || coercedType.check x; + check = x: finalType.check x || (coercedType.check x && finalType.check (coerceFunc x)); merge = loc: defs: let coerceVal = val: |