Skip to content

Commit 22a8b2c

Browse files
committed
Exclude Union{} from is_vararg_type
1 parent 9e740ce commit 22a8b2c

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ is_leaf(frame::Frame) = frame.callee === nothing
148148

149149
function is_vararg_type(x)
150150
if isa(x, Type)
151-
x <: Vararg && return true
151+
(x <: Vararg && !(x <: Union{})) && return true
152152
if isa(x, UnionAll)
153153
x = Base.unwrap_unionall(x)
154154
end

test/interpret.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ end
9999
# issue #6
100100
@test @interpret(Array.body.body.name) === Array.body.body.name
101101
@test @interpret(Vararg.body.body.name) === Vararg.body.body.name
102+
@test !JuliaInterpreter.is_vararg_type(Union{})
102103
frame = JuliaInterpreter.prepare_thunk(Main, :(Vararg.body.body.name))
103104
@test JuliaInterpreter.finish_and_return!(frame, true) === Vararg.body.body.name
104105
frame = JuliaInterpreter.prepare_thunk(Base, :(Union{AbstractChar,Tuple{Vararg{<:AbstractChar}},AbstractVector{<:AbstractChar},Set{<:AbstractChar}}))

0 commit comments

Comments
 (0)