Skip to content

Commit 523a220

Browse files
committed
Drop compat code for at-__MODULE__ (from #363)
1 parent 2dbd40b commit 523a220

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ Currently, the `@compat` macro supports the following syntaxes:
128128

129129
* `Compat.invokelatest` supports keywords ([#22646]).
130130

131-
* `@__MODULE__` is aliased to `current_module()` for Julia versions 0.6 and below. Versions of `Base.binding_module`, `expand`, `macroexpand`, and `include_string` were added that accept a module as the first argument. ([#22064])
132-
133131
* `Cmd` elements can be accessed as if the `Cmd` were an array of strings for 0.6 and below ([#21197]).
134132

135133
* `Val(x)` constructs `Val{x}()`. ([#22475])

src/Compat.jl

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,21 +7,6 @@ import Sockets
77

88
include("compatmacro.jl")
99

10-
# https://github.com/JuliaLang/julia/pull/22064
11-
@static if !isdefined(Base, Symbol("@__MODULE__"))
12-
# 0.7
13-
export @__MODULE__
14-
macro __MODULE__()
15-
return current_module()
16-
end
17-
Base.expand(mod::Module, x::ANY) = eval(mod, :(expand($(QuoteNode(x)))))
18-
Base.macroexpand(mod::Module, x::ANY) = eval(mod, :(macroexpand($(QuoteNode(x)))))
19-
Base.include_string(mod::Module, code::String, fname::String) =
20-
eval(mod, :(include_string($code, $fname)))
21-
Base.include_string(mod::Module, code::AbstractString, fname::AbstractString="string") =
22-
eval(mod, :(include_string($code, $fname)))
23-
end
24-
2510
@static if !isdefined(Base, :isabstracttype) # VERSION < v"0.7.0-DEV.3475"
2611
const isabstracttype = Base.isabstract
2712
export isabstracttype

test/old.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,10 @@ no_specialize_kw2(@nospecialize(x::Integer=0)) = sin(2)
4040
@test no_specialize_kw2(1.0) == sin(1)
4141
@test no_specialize_kw2(1) == sin(2)
4242
@test no_specialize_kw2() == sin(2)
43+
44+
# PR 22064
45+
module Test22064
46+
using Compat
47+
using Compat.Test
48+
@test (@__MODULE__) === Test22064
49+
end

test/runtests.jl

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,6 @@ for (t, s, m, kept) in [
132132
@test Compat.readuntil(IOBuffer(t), collect(s)::Vector{Char}, keep=true) == Vector{Char}(kept)
133133
end
134134

135-
# PR 22064
136-
module Test22064
137-
using Compat
138-
using Compat.Test
139-
@test (@__MODULE__) === Test22064
140-
end
141-
142135
# invokelatest with keywords
143136
pr22646(x; y=0) = 1
144137
let foo() = begin

0 commit comments

Comments
 (0)