Unverified Commit f54b76bc authored by Johannes Kirschbauer's avatar Johannes Kirschbauer Committed by GitHub
Browse files

lib/types: add doc warning to addCheck (#412364)

parents ac5a33bd 7063762d
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -1455,8 +1455,14 @@ let
          nestedTypes.coercedType = coercedType;
          nestedTypes.finalType = finalType;
        };
      /**
        Augment the given type with an additional type check function.

      # Augment the given type with an additional type check function.
        :::{.warning}
        This function has some broken behavior see: [#396021](https://github.com/NixOS/nixpkgs/issues/396021)
        Fixing is not trivial, we appreciate any help!
        :::
      */
      addCheck = elemType: check: elemType // { check = x: elemType.check x && check x; };

    };