From 03d618c11a0c2b178e839e78c3585bbc6f23cbd8 Mon Sep 17 00:00:00 2001 From: Shuhei Kadowaki Date: Tue, 15 Dec 2020 11:10:38 +0900 Subject: [PATCH] fix failures on nightly this essentially updates to https://github.com/JuliaLang/julia/pull/38835, where `_apply_latest` is renamed to `_call_latest` --- src/builtins.jl | 14 +++++++++++++- test/debug.jl | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/builtins.jl b/src/builtins.jl index 6a6e3a48..092d93a9 100644 --- a/src/builtins.jl +++ b/src/builtins.jl @@ -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...)) diff --git a/test/debug.jl b/test/debug.jl index a1a767a8..6ac34288 100644 --- a/test/debug.jl +++ b/test/debug.jl @@ -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)