@@ -174,7 +174,7 @@ const typeof_tfunc = function (t)
174
174
Type{typeof (t)}
175
175
end
176
176
elseif isa (t,DataType)
177
- if isleaftype (t)
177
+ if isleaftype (t) || isvarargtype (t)
178
178
Type{t}
179
179
else
180
180
Type{TypeVar (:_ ,t)}
@@ -222,7 +222,7 @@ function limit_type_depth(t::ANY, d::Int, cov::Bool, vars)
222
222
else
223
223
return t
224
224
end
225
- if inexact
225
+ if inexact && ! isvarargtype (R)
226
226
R = TypeVar (:_ ,R)
227
227
push! (vars, R)
228
228
end
@@ -319,7 +319,7 @@ const fieldtype_tfunc = function (A, s, name)
319
319
if is (t,Bottom)
320
320
return t
321
321
end
322
- Type{exact || isleaftype (t) || isa (t,TypeVar) ? t : TypeVar (:_ , t)}
322
+ Type{exact || isleaftype (t) || isa (t,TypeVar) || isvarargtype (t) ? t : TypeVar (:_ , t)}
323
323
end
324
324
t_func[fieldtype] = (2 , 2 , fieldtype_tfunc)
325
325
t_func[Box] = (1 , 1 , (a,)-> Box)
@@ -423,7 +423,7 @@ const apply_type_tfunc = function (A, args...)
423
423
if type_too_complex (appl,0 )
424
424
return Type{TypeVar (:_ ,headtype)}
425
425
end
426
- uncertain && ! isa (appl,TypeVar) ? Type{TypeVar (:_ ,appl)} : Type{appl}
426
+ uncertain && ! ( isa (appl,TypeVar) || isvarargtype (appl) ) ? Type{TypeVar (:_ ,appl)} : Type{appl}
427
427
end
428
428
t_func[apply_type] = (1 , Inf , apply_type_tfunc)
429
429
@@ -972,7 +972,7 @@ function abstract_eval(e::ANY, vtypes, sv::StaticVarInfo)
972
972
# abstract types yield Type{<:T} instead of Type{T}.
973
973
# this doesn't really model the situation perfectly, but
974
974
# "isleaftype(inference_stack.types)" should be good enough.
975
- if isa (t,TypeVar)
975
+ if isa (t,TypeVar) || isvarargtype (t)
976
976
t = Type{t}
977
977
else
978
978
t = Type{TypeVar (:_ ,t)}
0 commit comments