Skip to content

Commit d6d35f1

Browse files
committed
Drop compat code for parentmodule from #461
1 parent e4752e4 commit d6d35f1

File tree

4 files changed

+7
-19
lines changed

4 files changed

+7
-19
lines changed

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,6 @@ Currently, the `@compat` macro supports the following syntaxes:
143143

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

146-
* `module_parent`, `Base.function_module`, and `Base.datatype_module` are now methods of
147-
a new function called `parentmodule` ([#25629]).
148-
149146
* `module_name`, `Base.function_name`, and `Base.datatype_name` are now methods of a
150147
new function called `nameof` ([#25622]).
151148

src/Compat.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,6 @@ end
7171
end
7272
end
7373

74-
@static if !isdefined(Base, :parentmodule)
75-
parentmodule(m::Module) = Base.module_parent(m)
76-
parentmodule(f::Function) = Base.function_module(f)
77-
parentmodule(@nospecialize(f), @nospecialize(t)) = Base.function_module(f, t)
78-
parentmodule(t::DataType) = Base.datatype_module(t)
79-
parentmodule(t::UnionAll) = Base.datatype_module(Base.unwrap_unionall(t))
80-
export parentmodule
81-
end
82-
8374
@static if !isdefined(Base, :codeunits)
8475
codeunits(s::String) = Vector{UInt8}(s)
8576
ncodeunits(s::Union{String,SubString{String}}) = sizeof(s)

test/old.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,3 +649,10 @@ end
649649
@test argmin([10 12; 9 11]) == CartesianIndex(2, 1)
650650
@test argmin(Dict(:z=>10, :y=>12, :x=>9, :w=>11)) == :x
651651
@test argmin((1.0, -3, 0.f0)) == 2
652+
653+
# 0.7.0-DEV.3460
654+
@test parentmodule(Compat.Sys) == Compat
655+
@test parentmodule(sin) == Base
656+
@test parentmodule(sin, Tuple{Int}) == Base.Math
657+
@test parentmodule(Int) == Core
658+
@test parentmodule(Array) == Core

test/runtests.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,6 @@ let A = [1]
8080
@test x == 1
8181
end
8282

83-
# 0.7.0-DEV.3460
84-
@test parentmodule(Compat.Sys) == Compat
85-
@test parentmodule(sin) == Base
86-
@test parentmodule(sin, Tuple{Int}) == Base.Math
87-
@test parentmodule(Int) == Core
88-
@test parentmodule(Array) == Core
89-
9083
@test codeunits("foo") == [0x66,0x6f,0x6f] == codeunits(SubString("fooαβγ",1,3))
9184
@test ncodeunits("αβγ") == 6 == ncodeunits(SubString("fooαβγ",4,8))
9285
@test codeunit("foo") == codeunit(SubString("fooαβγ",1,3)) == UInt8

0 commit comments

Comments
 (0)