From 139bec4cfda51c7229bc224211e28b8e6c5e1ac0 Mon Sep 17 00:00:00 2001 From: Clark Kampfe Date: Tue, 10 Dec 2024 16:51:43 -0600 Subject: [PATCH] allow min and max in guard tests --- lib/elixir/lib/kernel.ex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/elixir/lib/kernel.ex b/lib/elixir/lib/kernel.ex index 31a9a4c8c65..db235db6921 100644 --- a/lib/elixir/lib/kernel.ex +++ b/lib/elixir/lib/kernel.ex @@ -972,7 +972,7 @@ defmodule Kernel do comparison"](#module-structural-comparison) section for more information. - Inlined by the compiler. + Allowed in guard tests. Inlined by the compiler. ## Examples @@ -982,6 +982,7 @@ defmodule Kernel do "b" """ + @doc guard: true @spec max(first, second) :: first | second when first: term, second: term def max(first, second) do :erlang.max(first, second) @@ -998,7 +999,7 @@ defmodule Kernel do comparison"](#module-structural-comparison) section for more information. - Inlined by the compiler. + Allowed in guard tests. Inlined by the compiler. ## Examples @@ -1008,6 +1009,7 @@ defmodule Kernel do "bar" """ + @doc guard: true @spec min(first, second) :: first | second when first: term, second: term def min(first, second) do :erlang.min(first, second)