Skip to content

Commit 36b6850

Browse files
aviatesksimeonschaub
authored andcommitted
fix failures on nightly
this essentially updates to JuliaLang/julia#38835, where `_apply_latest` is renamed to `_call_latest`
1 parent c097abb commit 36b6850

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/builtins.jl

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,19 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
6363
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
6464
end
6565
return new_expr
66-
elseif f === Core._apply_latest
66+
elseif @static isdefined(Core, :_call_latest) ? f === Core._call_latest : false
67+
argswrapped = getargs(args, frame)
68+
if !expand
69+
return Some{Any}(Core._call_latest(argswrapped...))
70+
end
71+
new_expr = Expr(:call, argswrapped[1])
72+
popfirst!(argswrapped)
73+
argsflat = append_any(argswrapped...)
74+
for x in argsflat
75+
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
76+
end
77+
return new_expr
78+
elseif @static isdefined(Core, :_apply_latest) ? f === Core._apply_latest : false
6779
argswrapped = getargs(args, frame)
6880
if !expand
6981
return Some{Any}(Core._apply_latest(argswrapped...))

test/debug.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ end
390390
@test get_return(frame) == f_inv(2)
391391
end
392392

393-
f_inv_latest(x::Real) = 1 + Core._apply_latest(f_inv, x)
393+
f_inv_latest(x::Real) = 1 + (@static isdefined(Core, :_call_latest) ? Core._call_latest(f_inv, x) : Core._apply_latest(f_inv, x))
394394
@testset "invokelatest" begin
395395
fr = JuliaInterpreter.enter_call(f_inv_latest, 2.0)
396396
fr, pc = JuliaInterpreter.debug_command(fr, :nc)

0 commit comments

Comments
 (0)