Skip to content

Commit

Permalink
Fix typespec for Stream.with_index/2 (elixir-lang#13488)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabiwara authored Apr 9, 2024
1 parent 5611235 commit b829f1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/elixir/lib/stream.ex
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,9 @@ defmodule Stream do
[1, 3, 5]
"""
@spec with_index(Enumerable.t(), integer) :: Enumerable.t()
@spec with_index(Enumerable.t(), integer) :: Enumerable.t({element, integer})
@spec with_index(Enumerable.t(), (element, index -> return_value)) :: Enumerable.t(return_value)
when return_value: term
def with_index(enum, fun_or_offset \\ 0)

def with_index(enum, offset) when is_integer(offset) do
Expand Down

0 comments on commit b829f1b

Please sign in to comment.