Skip to content

Commit

Permalink
Drop compat code for nameof from #471
Browse files Browse the repository at this point in the history
  • Loading branch information
martinholters committed Oct 8, 2019
1 parent 3e8d7b9 commit d179c6e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 16 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ Currently, the `@compat` macro supports the following syntaxes:

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

* `module_name`, `Base.function_name`, and `Base.datatype_name` are now methods of a
new function called `nameof` ([#25622]).

* `search` is now `findfirst`/`findnext` and `rsearch` is now `findlast`/`findprev`,
sometimes combined with `isequal` or `in` ([#24673], [#26436]).

Expand Down
7 changes: 0 additions & 7 deletions src/Compat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ end
end
end

@static if !isdefined(Base, :nameof)
nameof(m::Module) = Base.module_name(m)
nameof(f::Function) = Base.function_name(f)
nameof(t::Union{DataType,UnionAll}) = Base.datatype_name(t)
export nameof
end

# 0.7.0-DEV.3469
@static if !isdefined(Base, :GC)
@eval module GC
Expand Down
6 changes: 6 additions & 0 deletions test/old.jl
Original file line number Diff line number Diff line change
Expand Up @@ -659,3 +659,9 @@ end

@test codeunits("foo") == [0x66,0x6f,0x6f] == codeunits(SubString("fooαβγ",1,3))
@test ncodeunits("αβγ") == 6 == ncodeunits(SubString("fooαβγ",4,8))

# 0.7.0-DEV.3539
@test nameof(Compat.Sys) == :Sys
@test nameof(sin) == :sin
@test nameof(Float64) == :Float64
@test nameof(Array) == :Array
6 changes: 0 additions & 6 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,6 @@ end

@test codeunit("foo") == codeunit(SubString("fooαβγ",1,3)) == UInt8

# 0.7.0-DEV.3539
@test nameof(Compat.Sys) == :Sys
@test nameof(sin) == :sin
@test nameof(Float64) == :Float64
@test nameof(Array) == :Array

module TestPkg
using Compat
using Compat.Pkg
Expand Down

0 comments on commit d179c6e

Please sign in to comment.