Skip to content

Commit

Permalink
Merge pull request #490 from JuliaDebug/teh/testfail_promote_typeof
Browse files Browse the repository at this point in the history
Don't splat in call to `append_any`
  • Loading branch information
pfitzseb authored Jul 28, 2021
2 parents 0a78c30 + 84bd33f commit 38025d7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "JuliaInterpreter"
uuid = "aa1ae85d-cabe-5617-a682-6adf51b2e16a"
version = "0.8.18"
version = "0.8.19"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Expand Down
11 changes: 5 additions & 6 deletions bin/generate_builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 10 additions & 12 deletions src/builtins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,26 +64,24 @@ function maybe_evaluate_builtin(frame, call_expr, expand::Bool)
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
Expand Down
2 changes: 2 additions & 0 deletions test/dummy_file.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Don't change the value below, it's used in an `include` test
55
7 changes: 7 additions & 0 deletions test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -811,3 +811,10 @@ end
JuliaInterpreter.finish_and_return!(Frame(m, ex), true)
@test isdefined(m, :foo)
end

# Related to fixing https://github.com/timholy/Revise.jl/issues/625
module ForInclude end
@testset "include" begin
ex = :(include("dummy_file.jl"))
@test JuliaInterpreter.finish_and_return!(Frame(ForInclude, ex), true) == 55
end

2 comments on commit 38025d7

@pfitzseb
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/41711

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.8.19 -m "<description of version>" 38025d7c865b6936d01590a0daea696f78ce4397
git push origin v0.8.19

Please sign in to comment.