Skip to content

Commit 6a8f49f

Browse files
committed
Drop compat code for invokelatest from #424
1 parent 939ae7e commit 6a8f49f

File tree

4 files changed

+11
-21
lines changed

4 files changed

+11
-21
lines changed

README.md

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

121121
* `isnothing` for testing if a variable is equal to `nothing` ([#29674]).
122122

123-
* `Compat.invokelatest` supports keywords ([#22646]).
124-
125123
* `Cmd` elements can be accessed as if the `Cmd` were an array of strings for 0.6 and below ([#21197]).
126124

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

src/Compat.jl

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,10 @@ module TypeUtils
1010
const isabstract = isabstracttype
1111
export isabstract, parameter_upper_bound, typename
1212
end # module TypeUtils
13+
import Base.invokelatest
1314

1415
include("compatmacro.jl")
1516

16-
# https://github.com/JuliaLang/julia/pull/22646
17-
if VERSION < v"0.7.0-DEV.1139"
18-
function invokelatest(f, args...; kwargs...)
19-
inner() = f(args...; kwargs...)
20-
Base.invokelatest(inner)
21-
end
22-
else
23-
import Base.invokelatest
24-
end
25-
2617
# https://github.com/JuliaLang/julia/pull/21197
2718
if VERSION < v"0.7.0-DEV.257"
2819
# allow the elements of the Cmd to be accessed as an array or iterator

test/old.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@ struct ConcreteFoo20006N{T<:Int,N} <: AbstractFoo20006 end
2727
@test Compat.TypeUtils.parameter_upper_bound(ConcreteFoo20006, 1) == Int
2828
@test isa(Compat.TypeUtils.typename(Array), Core.TypeName)
2929

30+
# invokelatest with keywords
31+
pr22646(x; y=0) = 1
32+
let foo() = begin
33+
eval(:(pr22646(x::Int; y=0) = 2))
34+
return Compat.invokelatest(pr22646, 0, y=1)
35+
end
36+
@test foo() == 2
37+
end
38+
39+
3040
# tests of removed functionality (i.e. justs tests Base)
3141

3242
# 25959

test/runtests.jl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ for x in (3.1, -17, 3//4, big(111.1), Inf)
6767
@test minmax(x) == (x, x)
6868
end
6969

70-
# invokelatest with keywords
71-
pr22646(x; y=0) = 1
72-
let foo() = begin
73-
eval(:(pr22646(x::Int; y=0) = 2))
74-
return Compat.invokelatest(pr22646, 0, y=1)
75-
end
76-
@test foo() == 2
77-
end
78-
7970
# PR #21197
8071
let c = `ls -l "foo bar"`
8172
@test collect(c) == ["ls", "-l", "foo bar"]

0 commit comments

Comments
 (0)