diff --git a/src/base-traits.jl b/src/base-traits.jl index 9feccc2..6bc19a3 100644 --- a/src/base-traits.jl +++ b/src/base-traits.jl @@ -4,7 +4,7 @@ using SimpleTraits using Compat export IsLeafType, IsBits, IsImmutable, IsContiguous, IsIndexLinear, - IsAnything, IsNothing, IsCallable, IsIterable + IsAnything, IsNothing, IsCallable, IsIterator "Trait which contains all types" @traitdef IsAnything{X} @@ -57,10 +57,10 @@ end Base.@deprecate_binding IsFastLinearIndex IsIndexLinear -"Trait of all iterable types" -@traitdef IsIterable{X} -@generated function SimpleTraits.trait{X}(::Type{IsIterable{X}}) - method_exists(start, Tuple{X}) ? :(IsIterable{X}) : :(Not{IsIterable{X}}) +"Trait of all iterator types" +@traitdef IsIterator{X} +@generated function SimpleTraits.trait{X}(::Type{IsIterator{X}}) + method_exists(start, Tuple{X}) ? :(IsIterator{X}) : :(Not{IsIterator{X}}) end end # module diff --git a/test/base-traits.jl b/test/base-traits.jl index 6a87cca..a9a6dba 100644 --- a/test/base-traits.jl +++ b/test/base-traits.jl @@ -29,7 +29,7 @@ c = view(a, 1:2:5) type T9867 end @test istrait(IsCallable{T9867}) -@test istrait(IsIterable{Array}) -@test !istrait(IsIterable{Cmd}) -@test istrait(IsIterable{Base.UnitRange{Int}}) -@test istrait(IsIterable{Base.UnitRange}) +@test istrait(IsIterator{Array}) +@test !istrait(IsIterator{Cmd}) +@test istrait(IsIterator{Base.UnitRange{Int}}) +@test istrait(IsIterator{Base.UnitRange})