Skip to content

Commit 320f89b

Browse files
committed
fix vararg unionall handling
1 parent 9191196 commit 320f89b

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

src/construct.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,8 @@ function prepare_call(@nospecialize(f), allargs; enter_generated = false)
206206
# Can happen for thunks created by generated functions
207207
if isa(f, Core.Builtin) || isa(f, Core.IntrinsicFunction)
208208
return nothing
209-
elseif any(x->isa(x, Type) && x <: Vararg, allargs)
209+
elseif any(x -> isa(x, Type) &&
210+
(x <: Vararg || (typeof(x) in (UnionAll, DataType) && nameof(x) == :Vararg)), allargs)
210211
return nothing # https://github.com/JuliaLang/julia/issues/30995
211212
end
212213
argtypes = Tuple{map(_Typeof,allargs)...}

test/interpret.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,3 +370,11 @@ end
370370
end
371371
@test @interpret h_gf() == 2
372372
end
373+
374+
# https://github.com/JuliaDebug/JuliaInterpreter.jl/issues/130
375+
@testset "vararg handling" begin
376+
method_c1(x::Float64, s::AbstractString...) = true
377+
buf = IOBuffer()
378+
me = Base.MethodError(method_c1,(1, 1, ""))
379+
@test (@interpret Base.show_method_candidates(buf, me)) == nothing
380+
end

0 commit comments

Comments
 (0)