Skip to content

Commit cddc8ca

Browse files
committed
Correct the absolute-time argument type for Process.send_after/4
Assisted-by: Codex CLI:GPT 6.1 Sol
1 parent 3efc937 commit cddc8ca

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/elixir/lib/process.ex‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,8 @@ defmodule Process do
387387
The message is not sent immediately. Therefore, `dest` can receive other messages
388388
in-between even when `time` is `0`.
389389
390+
`time` must be non-negative unless the `:abs` option is `true`.
391+
390392
This function returns a timer reference, which can be read with `read_timer/1`
391393
or canceled with `cancel_timer/1`.
392394
@@ -408,7 +410,7 @@ defmodule Process do
408410
timer_ref = Process.send_after(pid, :hi, 1000)
409411
410412
"""
411-
@spec send_after(pid | atom, term, non_neg_integer, [option]) :: reference
413+
@spec send_after(pid | atom, term, integer, [option]) :: reference
412414
when option: {:abs, boolean}
413415
def send_after(dest, msg, time, opts \\ []) do
414416
:erlang.send_after(time, dest, msg, opts)

0 commit comments

Comments
 (0)