Skip to content

Commit b639d87

Browse files
authored
Refine Enum.concat specs (#15554)
1 parent b3797d0 commit b639d87

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

lib/elixir/lib/enum.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -666,7 +666,7 @@ defmodule Enum do
666666
[1, [2], 3, 4, 5, 6]
667667
668668
"""
669-
@spec concat(t) :: t
669+
@spec concat(Enumerable.t(Enumerable.t(elem))) :: [elem] when elem: term
670670
def concat(enumerables)
671671

672672
def concat(list) when is_list(list) do
@@ -681,8 +681,8 @@ defmodule Enum do
681681
Concatenates the enumerable on the `right` with the enumerable on the
682682
`left`.
683683
684-
This function produces the same result as the `++/2` operator
685-
for lists.
684+
This function behaves similarly to the `++/2` operator with proper
685+
lists, but applied to enumerables.
686686
687687
## Examples
688688
@@ -693,7 +693,7 @@ defmodule Enum do
693693
[1, 2, 3, 4, 5, 6]
694694
695695
"""
696-
@spec concat(t, t) :: t
696+
@spec concat(Enumerable.t(elem), Enumerable.t(elem)) :: [elem] when elem: term
697697
def concat(left, right) when is_list(left) and is_list(right) do
698698
left ++ right
699699
end

0 commit comments

Comments
 (0)