Skip to content

Commit

Permalink
improve eltype of Count definition (#42427)
Browse files Browse the repository at this point in the history
Fixes review item #37747 (comment)
  • Loading branch information
vtjnash authored Sep 30, 2021
1 parent c8b5904 commit 6a335e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/iterators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ countfrom(start) = Count(start, oneunit(start))
countfrom() = Count(1, 1)


eltype(::Type{Count{T,S}}) where {T,S} = T
eltype(::Type{<:Count{T}}) where {T} = T

iterate(it::Count, state=it.start) = (state, state + it.step)

Expand Down

0 comments on commit 6a335e3

Please sign in to comment.