Skip to content

Commit 04d1fb5

Browse files
authored
Circumvent removal of append_any from nightly (fixes #282) (#286)
1 parent 80b900e commit 04d1fb5

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

bin/generate_builtins.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
147147
end
148148
new_expr = Expr(:call, argswrapped[1])
149149
popfirst!(argswrapped)
150-
argsflat = Base.append_any(argswrapped...)
150+
argsflat = append_any(argswrapped...)
151151
for x in argsflat
152152
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
153153
end

src/JuliaInterpreter.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ end
2828

2929
const SlotNamesType = VERSION < v"1.2.0-DEV.606" ? Vector{Any} : Vector{Symbol}
3030

31+
@static if VERSION < v"1.3.0-DEV.179"
32+
const append_any = Base.append_any
33+
else
34+
append_any(@nospecialize x...) = append!([], Core.svec((x...)...))
35+
end
36+
3137
include("types.jl")
3238
include("utils.jl")
3339
include("construct.jl")

src/builtins.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
5555
end
5656
new_expr = Expr(:call, argswrapped[1])
5757
popfirst!(argswrapped)
58-
argsflat = Base.append_any(argswrapped...)
58+
argsflat = append_any(argswrapped...)
5959
for x in argsflat
6060
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
6161
end
@@ -67,7 +67,7 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
6767
end
6868
new_expr = Expr(:call, argswrapped[1])
6969
popfirst!(argswrapped)
70-
argsflat = Base.append_any(argswrapped...)
70+
argsflat = append_any(argswrapped...)
7171
for x in argsflat
7272
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
7373
end

src/construct.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ function prepare_args(@nospecialize(f), allargs, kwargs)
122122
allargs = [f, namedtuple(kwargs), allargs...]
123123
elseif f === Core._apply
124124
f = to_function(allargs[2])
125-
allargs = Base.append_any((allargs[2],), allargs[3:end]...)
125+
allargs = append_any((allargs[2],), allargs[3:end]...)
126126
end
127127
return f, allargs
128128
end

0 commit comments

Comments
 (0)