about summary refs log tree commit diff
path: root/nix/yants
diff options
context:
space:
mode:
Diffstat (limited to 'nix/yants')
-rw-r--r--nix/yants/default.nix13
1 files changed, 9 insertions, 4 deletions
diff --git a/nix/yants/default.nix b/nix/yants/default.nix
index 058444d27be9..2bbf4dd15a9e 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";
   };
 
 })