Skip to content

Commit

Permalink
Merge pull request #131 from pfitzseb/sp/vararg
Browse files Browse the repository at this point in the history
fix vararg unionall handling
  • Loading branch information
timholy authored Mar 13, 2019
2 parents b96c37e + 320f89b commit 02a8d3c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/construct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,8 @@ function prepare_call(@nospecialize(f), allargs; enter_generated = false)
# Can happen for thunks created by generated functions
if isa(f, Core.Builtin) || isa(f, Core.IntrinsicFunction)
return nothing
elseif any(x->isa(x, Type) && x <: Vararg, allargs)
elseif any(x -> isa(x, Type) &&
(x <: Vararg || (typeof(x) in (UnionAll, DataType) && nameof(x) == :Vararg)), allargs)
return nothing # https://github.com/JuliaLang/julia/issues/30995
end
argtypes = Tuple{map(_Typeof,allargs)...}
Expand Down
8 changes: 8 additions & 0 deletions test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -370,3 +370,11 @@ end
end
@test @interpret h_gf() == 2
end

# https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/130
@testset "vararg handling" begin
method_c1(x::Float64, s::AbstractString...) = true
buf = IOBuffer()
me = Base.MethodError(method_c1,(1, 1, ""))
@test (@interpret Base.show_method_candidates(buf, me)) == nothing
end

0 comments on commit 02a8d3c

Please sign in to comment.