Skip to content
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

fix vararg unionall handling #131

Merged
merged 1 commit into from
Mar 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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