Skip to content

Commit

Permalink
Drop compat code for isabstracttype and isconcretetype (from #477)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 20b3ff8 commit e546efa
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 30 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -323,9 +323,6 @@ Currently, the `@compat` macro supports the following syntaxes:
for entries with no match and gives the index of the first (rather than the last) match
([#25662], [#25998]).

* `isabstract` and `isleaftype` are now `isabstracttype` and `isconcretetype`, respectively
([#23666], [#25496]).

* `gc` and `gc_enable` are now `GC.gc` and `GC.enable`, respectively ([#25616]).

* `endof` is now `lastindex` ([#25458]). (Note that `lastindex(A, n)` is not supported.)
Expand Down
19 changes: 0 additions & 19 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ import Sockets

include("compatmacro.jl")

@static if !isdefined(Base, :isabstracttype) # VERSION < v"0.7.0-DEV.3475"
const isabstracttype = Base.isabstract
export isabstracttype
end

module TypeUtils
using Base: parameter_upper_bound, typename
using Compat: isabstracttype
Expand Down Expand Up @@ -285,20 +280,6 @@ if VERSION < v"0.7.0-DEV.1325"
end
end


# 0.7.0-DEV.3475
@static if !isdefined(Base, :isconcretetype)
# 0.7.0-DEV.1775
@static if !isdefined(Base, :isconcrete)
const isconcretetype = isleaftype
const isconcrete = isleaftype # for compatibility with earlier Compat versions
export isconcrete
else
const isconcretetype = isconcrete
end
export isconcretetype
end

# 0.7.0-DEV.2005
if VERSION < v"0.7.0-DEV.2005"
const Mmap = Base.Mmap
Expand Down
8 changes: 8 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ using Compat
using Compat.Test
@test (@__MODULE__) === Test22064
end

@test isabstracttype(AbstractFoo20006)
@test !isabstracttype(ConcreteFoo20006)
@test !isabstracttype(ConcreteFoo20006N)
@test !isabstracttype(ConcreteFoo200061)
@test !isabstracttype(StridedArray)
# 0.7
@test isconcretetype(Int)
8 changes: 0 additions & 8 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ eval(Expr(
@test !Compat.TypeUtils.isabstract(StridedArray)
@test Compat.TypeUtils.parameter_upper_bound(ConcreteFoo20006, 1) == Int
@test isa(Compat.TypeUtils.typename(Array), Core.TypeName)
@test isabstracttype(AbstractFoo20006)
@test !isabstracttype(ConcreteFoo20006)
@test !isabstracttype(ConcreteFoo20006N)
@test !isabstracttype(ConcreteFoo200061)
@test !isabstracttype(StridedArray)

# PR 20203
@test Compat.readline(IOBuffer("Hello, World!\n")) == "Hello, World!"
Expand Down Expand Up @@ -320,9 +315,6 @@ if VERSION < v"0.7.0-DEV.5238"
@test cov([1, 2], [0, 10], corrected=false) === 2.5
end

# 0.7
@test isconcretetype(Int)

# 0.7
module Test23876
using Compat
Expand Down

0 comments on commit e546efa

Please sign in to comment.