-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't splat in call to append_any
#490
Conversation
Codecov Report
@@ Coverage Diff @@
## master #490 +/- ##
==========================================
+ Coverage 86.86% 86.93% +0.06%
==========================================
Files 12 12
Lines 2338 2334 -4
==========================================
- Hits 2031 2029 -2
+ Misses 307 305 -2
Continue to review full report at Codecov.
|
Here's the full stacktrace on
Do we need to remove more of those splats? I confess to not looking closely. |
IIUC we only want the diff --git a/bin/generate_builtins.jl b/bin/generate_builtins.jl
index 1b86054..40393ce 100644
--- a/bin/generate_builtins.jl
+++ b/bin/generate_builtins.jl
@@ -146,14 +146,13 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
print(io,
"""
$head f === $fstr
- argswrapped = getargs(args, frame)
+ args = getargs(args, frame)
if !expand
- return Some{Any}($fstr(argswrapped...))
+ return Some{Any}($fstr(args...))
end
- new_expr = Expr(:call, argswrapped[1])
- popfirst!(argswrapped)
- argsflat = append_any(argswrapped...)
- for x in argsflat
+ new_expr = Expr(:call, args[1])
+ popfirst!(args)
+ for x in args
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
end
return new_expr
diff --git a/src/builtins.jl b/src/builtins.jl
index 6160e80..599f660 100644
--- a/src/builtins.jl
+++ b/src/builtins.jl
@@ -52,38 +52,35 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
return Some{Any}(===(getargs(args, frame)...))
end
elseif f === Core._apply
- argswrapped = getargs(args, frame)
+ args = getargs(args, frame)
if !expand
- return Some{Any}(Core._apply(argswrapped...))
+ return Some{Any}(Core._apply(args...))
end
- new_expr = Expr(:call, argswrapped[1])
- popfirst!(argswrapped)
- argsflat = append_any(argswrapped...)
- for x in argsflat
+ new_expr = Expr(:call, args[1])
+ popfirst!(args)
+ for x in args
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
end
return new_expr
elseif @static isdefined(Core, :_call_latest) ? f === Core._call_latest : false
- argswrapped = getargs(args, frame)
+ args = getargs(args, frame)
if !expand
- return Some{Any}(Core._call_latest(argswrapped...))
+ return Some{Any}(Core._call_latest(args...))
end
- new_expr = Expr(:call, argswrapped[1])
- popfirst!(argswrapped)
- argsflat = append_any(argswrapped)
- for x in argsflat
+ new_expr = Expr(:call, args[1])
+ popfirst!(args)
+ for x in args
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)
+ args = getargs(args, frame)
if !expand
- return Some{Any}(Core._apply_latest(argswrapped...))
+ return Some{Any}(Core._apply_latest(args...))
end
- new_expr = Expr(:call, argswrapped[1])
- popfirst!(argswrapped)
- argsflat = append_any(argswrapped...)
- for x in argsflat
+ new_expr = Expr(:call, args[1])
+ popfirst!(args)
+ for x in args
push!(new_expr.args, (isa(x, Symbol) || isa(x, Expr) || isa(x, QuoteNode)) ? QuoteNode(x) : x)
end
return new_expr is probably correct, but unfortunately only the test added here actually hits any of that code. |
Feel free to push that diff to this branch and I'll look into adding tests. |
Can we get this merged? |
👍 |
Fixes timholy/Revise.jl#625