diff --git a/nix/yants/default.nix b/nix/yants/default.nix index 058444d27..2bbf4dd15 100644 --- a/nix/yants/default.nix +++ b/nix/yants/default.nix @@ -317,10 +317,15 @@ in lib.fix (self: { in if !(t.checkToBool res) then res - else { - ok = pred v; - err = "${prettyPrint v} does not conform to restriction '${restriction}'"; - }; + else + let + iok = pred v; + in if isBool iok then { + ok = iok; + err = "${prettyPrint v} does not conform to restriction '${restriction}'"; + } else + # use throw here to avoid spamming the build log + throw "restriction '${restriction}' predicate returned unexpected value '${prettyPrint iok}' instead of boolean"; }; })