Skip to content

Commit

Permalink
don't use abstract_iteration for types with special cases in _apply (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson authored Jan 2, 2019
1 parent 7ba11d1 commit 3e6f607
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions base/compiler/abstractinterpretation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -405,12 +405,27 @@ function precise_container_type(@nospecialize(typ), vtypes::VarTable, sv::Infere
end
end
return result
elseif isa(tti0, DataType) && tti0 <: Tuple
if isvatuple(tti0) && length(tti0.parameters) == 1
return Any[Vararg{unwrapva(tti0.parameters[1])}]
elseif tti0 <: Tuple
if isa(tti0, DataType)
if isvatuple(tti0) && length(tti0.parameters) == 1
return Any[Vararg{unwrapva(tti0.parameters[1])}]
else
return Any[ p for p in tti0.parameters ]
end
elseif !isa(tti, DataType)
return Any[Vararg{Any}]
else
return Any[ p for p in tti0.parameters ]
len = length(tti.parameters)
last = tti.parameters[len]
va = isvarargtype(last)
elts = Any[ fieldtype(tti0, i) for i = 1:len ]
if va
elts[len] = Vararg{elts[len]}
end
return elts
end
elseif tti0 === SimpleVector || tti0 === Any
return Any[Vararg{Any}]
elseif tti0 <: Array
return Any[Vararg{eltype(tti0)}]
else
Expand Down

0 comments on commit 3e6f607

Please sign in to comment.