Skip to content

Commit 7cca6c7

Browse files
committed
Revert "remove "where" syntax, for 0.5 compatibility"
This reverts commit 50636d2.
1 parent 1f05af4 commit 7cca6c7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/Primes.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ Base.done(np::NextPrimes, state) = false
682682
Base.iteratorsize(::Type{<:NextPrimes}) = Base.IsInfinite()
683683
Base.iteratoreltype(::Type{<:NextPrimes}) = Base.HasEltype() # default
684684

685-
Base.eltype{T}(::Type{NextPrimes{T}}) = T
685+
Base.eltype(::Type{NextPrimes{T}}) where {T} = T
686686

687687
"""
688688
nextprimes(start::Integer)
@@ -698,7 +698,7 @@ nextprimes(start::Integer) = NextPrimes(start)
698698
Returns an iterator over all primes, with type `T`.
699699
Equivalent to `nextprimes(T(1))`.
700700
"""
701-
nextprimes{T<:Integer}(::Type{T}) = nextprimes(one(T))
701+
nextprimes(::Type{T}) where {T<:Integer} = nextprimes(one(T))
702702
nextprimes() = nextprimes(Int)
703703

704704
"""
@@ -716,7 +716,7 @@ julia> nextprimes(10, 3)
716716
17
717717
```
718718
"""
719-
nextprimes{T<:Integer}(start::T, n::Integer) = collect(T, take(nextprimes(start), n))
719+
nextprimes(start::T, n::Integer) where {T<:Integer} = collect(T, take(nextprimes(start), n))
720720

721721
struct PrevPrimes{T<:Integer}
722722
start::T
@@ -729,7 +729,7 @@ done(np::PrevPrimes, state) = state == 2
729729
iteratorsize(::Type{<:PrevPrimes}) = Base.SizeUnknown()
730730
iteratoreltype(::Type{<:PrevPrimes}) = Base.HasEltype() # default
731731

732-
eltype{T}(::Type{PrevPrimes{T}}) = T
732+
eltype(::Type{PrevPrimes{T}}) where {T} = T
733733

734734
"""
735735
prevprimes(start::Integer)
@@ -766,6 +766,6 @@ julia> prevprimes(10, 3)
766766
3
767767
```
768768
"""
769-
prevprimes{T<:Integer}(start::T, n::Integer) = collect(T, take(prevprimes(start, n)))
769+
prevprimes(start::T, n::Integer) where {T<:Integer} = collect(T, take(prevprimes(start, n)))
770770

771771
end # module

0 commit comments

Comments
 (0)