Skip to content

Commit

Permalink
fix failures on nightly
Browse files Browse the repository at this point in the history
this essentially updates to 
JuliaLang/julia#38835, 
where `_apply_latest` is renamed to `_call_latest`
  • Loading branch information
aviatesk authored and simeonschaub committed Dec 17, 2020
1 parent 2b3b88b commit 03d618c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion src/builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,19 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
end
return new_expr
elseif f === Core._apply_latest
elseif @static isdefined(Core, :_call_latest) ? f === Core._call_latest : false
argswrapped = getargs(args, frame)
if !expand
return Some{Any}(Core._call_latest(argswrapped...))
end
new_expr = Expr(:call, argswrapped[1])
popfirst!(argswrapped)
argsflat = append_any(argswrapped...)
for x in argsflat
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
end
return new_expr
elseif @static isdefined(Core, :_apply_latest) ? f === Core._apply_latest : false
argswrapped = getargs(args, frame)
if !expand
return Some{Any}(Core._apply_latest(argswrapped...))
Expand Down
2 changes: 1 addition & 1 deletion test/debug.jl
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ end
@test get_return(frame) == f_inv(2)
end

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

0 comments on commit 03d618c

Please sign in to comment.