From d179c6e42f195ab2b9e00f280c223229a29cc320 Mon Sep 17 00:00:00 2001 From: Martin Holters Date: Tue, 8 Oct 2019 16:57:16 +0200 Subject: [PATCH] Drop compat code for `nameof` from #471 --- README.md | 3 --- src/Compat.jl | 7 ------- test/old.jl | 6 ++++++ test/runtests.jl | 6 ------ 4 files changed, 6 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 758b2cdc3..0f183f750 100644 --- a/README.md +++ b/README.md @@ -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]). diff --git a/src/Compat.jl b/src/Compat.jl index 4992957b1..21dcd604c 100644 --- a/src/Compat.jl +++ b/src/Compat.jl @@ -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 diff --git a/test/old.jl b/test/old.jl index 82064ef89..d70d2e2e5 100644 --- a/test/old.jl +++ b/test/old.jl @@ -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 diff --git a/test/runtests.jl b/test/runtests.jl index 3df00218a..e175502ea 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -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