Skip to content

Commit

Permalink
Mark Compat.IteratorSize and -Eltype from #451 for deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 4, 2019
1 parent 9c6ae72 commit 85c4c1d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 18 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ Currently, the `@compat` macro supports the following syntaxes:

* `reprmime(mime, x)` is now `repr(mime, x)` ([#25990]) and `mimewritable` is now `showable` ([#26089]).

* `Base.IteratorSize` and `Base.IteratorEltype` are available as
`Compat.IteratorSize` and `Compat.IteratorEltype` ([#25402]).

* `copy!` and `unsafe_copy!` are now `copyto!` and `unsafe_copyto!` ([#24808]).

* `ipermute!` is now `invpermute!` ([#25168]).
Expand Down
11 changes: 2 additions & 9 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ module Unicode
import Unicode: isassigned, normalize # not exported from Unicode module due to conflicts
end
import Base: notnothing
const IteratorSize = Base.IteratorSize
const IteratorEltype = Base.IteratorEltype


include("compatmacro.jl")
Expand All @@ -68,15 +70,6 @@ end
end
end

# 0.7.0-DEV.3309
@static if VERSION < v"0.7.0-DEV.3309"
const IteratorSize = Base.iteratorsize
const IteratorEltype = Base.iteratoreltype
else
const IteratorSize = Base.IteratorSize
const IteratorEltype = Base.IteratorEltype
end

# 0.7.0-DEV.3173
@static if !isdefined(Base, :invpermute!)
const invpermute! = ipermute!
Expand Down
6 changes: 6 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ end
@test Compat.notnothing(1) == 1
@test_throws ArgumentError Compat.notnothing(nothing)

# 0.7.0-DEV.3309
let v = [1, 2, 3]
@test Compat.IteratorSize(v) isa Base.HasShape
@test Compat.IteratorEltype(v) == Base.HasEltype()
end


# tests of removed functionality (i.e. justs tests Base)

Expand Down
6 changes: 0 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,6 @@ let A = [1]
@test x == 1
end

# 0.7.0-DEV.3309
let v = [1, 2, 3]
@test Compat.IteratorSize(v) isa Base.HasShape
@test Compat.IteratorEltype(v) == Base.HasEltype()
end

# 0.7.0-DEV.3057
let A = [0, 0, 0], B = [1, 2, 3]
@test copyto!(A, B) === A == B
Expand Down

0 comments on commit 85c4c1d

Please sign in to comment.