Skip to content

Commit c097abb

Browse files
Kenosimeonschaub
authored andcommitted
Adjust to upcoming Base Vararg change
1 parent fc3b614 commit c097abb

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/optimize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ function parametric_type_to_expr(t::Type)
243243
t isa Core.TypeofBottom && return t
244244
t isa UnionAll && (t = t.body)
245245
t = t::DataType
246-
if t <: Vararg
246+
if Base.isvarargtype(t)
247247
return Expr(:(...), t.parameters[1])
248248
end
249249
if t.hasfreetypevars

src/utils.jl

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,16 @@ end
248248
is_leaf(frame::Frame) = frame.callee === nothing
249249

250250
function is_vararg_type(x)
251-
if isa(x, Type)
252-
(x <: Vararg && !(x <: Union{})) && return true
253-
if isa(x, UnionAll)
254-
x = Base.unwrap_unionall(x)
251+
if isa(Vararg, Type)
252+
if isa(x, Type)
253+
(x <: Vararg && !(x <: Union{})) && return true
254+
if isa(x, UnionAll)
255+
x = Base.unwrap_unionall(x)
256+
end
257+
return isa(x, DataType) && nameof(x) == :Vararg
255258
end
256-
return isa(x, DataType) && nameof(x) == :Vararg
259+
else
260+
return isa(x, typeof(Vararg))
257261
end
258262
return false
259263
end

0 commit comments

Comments
 (0)