From cddc8ca183164ed83274d769cdc2ed992190770b Mon Sep 17 00:00:00 2001 From: preciz Date: Sun, 8 Nov 2026 14:14:56 +0100 Subject: [PATCH] Correct the absolute-time argument type for Process.send_after/4 Assisted-by: Codex CLI:GPT 6.1 Sol --- lib/elixir/lib/process.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/elixir/lib/process.ex b/lib/elixir/lib/process.ex index 4242aab6807..89ca222cbd0 100644 --- a/lib/elixir/lib/process.ex +++ b/lib/elixir/lib/process.ex @@ -387,6 +387,8 @@ defmodule Process do The message is not sent immediately. Therefore, `dest` can receive other messages in-between even when `time` is `0`. + `time` must be non-negative unless the `:abs` option is `true`. + This function returns a timer reference, which can be read with `read_timer/1` or canceled with `cancel_timer/1`. @@ -408,7 +410,7 @@ defmodule Process do timer_ref = Process.send_after(pid, :hi, 1000) """ - @spec send_after(pid | atom, term, non_neg_integer, [option]) :: reference + @spec send_after(pid | atom, term, integer, [option]) :: reference when option: {:abs, boolean} def send_after(dest, msg, time, opts \\ []) do :erlang.send_after(time, dest, msg, opts)