Skip to content

Commit a52d201

Browse files
authored
Add some specs to IEx.Helpers (#13372)
1 parent 7ffdc2b commit a52d201

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/iex/lib/iex/helpers.ex

+6
Original file line numberDiff line numberDiff line change
@@ -1346,6 +1346,7 @@ defmodule IEx.Helpers do
13461346
#PID<0.0.0>
13471347
13481348
"""
1349+
@spec pid(binary | atom) :: pid()
13491350
def pid("#PID<" <> string) do
13501351
:erlang.list_to_pid(~c"<#{string}")
13511352
end
@@ -1373,6 +1374,7 @@ defmodule IEx.Helpers do
13731374
#PID<0.64.2048>
13741375
13751376
"""
1377+
@spec pid(non_neg_integer, non_neg_integer, non_neg_integer) :: pid()
13761378
def pid(x, y, z)
13771379
when is_integer(x) and x >= 0 and is_integer(y) and y >= 0 and is_integer(z) and z >= 0 do
13781380
:erlang.list_to_pid(
@@ -1392,6 +1394,7 @@ defmodule IEx.Helpers do
13921394
13931395
"""
13941396
@doc since: "1.8.0"
1397+
@spec port(binary) :: port()
13951398
def port(string) when is_binary(string) do
13961399
:erlang.list_to_port(~c"#Port<#{string}>")
13971400
end
@@ -1408,6 +1411,7 @@ defmodule IEx.Helpers do
14081411
14091412
"""
14101413
@doc since: "1.8.0"
1414+
@spec port(non_neg_integer, non_neg_integer) :: port()
14111415
def port(major, minor)
14121416
when is_integer(major) and major >= 0 and is_integer(minor) and minor >= 0 do
14131417
:erlang.list_to_port(
@@ -1425,6 +1429,7 @@ defmodule IEx.Helpers do
14251429
14261430
"""
14271431
@doc since: "1.6.0"
1432+
@spec ref(binary) :: reference()
14281433
def ref(string) when is_binary(string) do
14291434
:erlang.list_to_ref(~c"#Ref<#{string}>")
14301435
end
@@ -1439,6 +1444,7 @@ defmodule IEx.Helpers do
14391444
14401445
"""
14411446
@doc since: "1.6.0"
1447+
@spec ref(non_neg_integer, non_neg_integer, non_neg_integer, non_neg_integer) :: reference()
14421448
def ref(w, x, y, z)
14431449
when is_integer(w) and w >= 0 and is_integer(x) and x >= 0 and is_integer(y) and y >= 0 and
14441450
is_integer(z) and z >= 0 do

0 commit comments

Comments
 (0)