mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-21 05:00:16 +00:00
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.
This commit is contained in:
parent
85b5fc7c98
commit
ef8996f15e
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue