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
1 changed files with 1 additions and 1 deletions
|
@ -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