@@ -873,16 +873,19 @@ function precise_container_types(args, types, vtypes::VarTable, sv)
873873 ai = args[i]
874874 ti = types[i]
875875 tti = widenconst (ti)
876- if isa (ai,Expr) && ai. head === :call && (abstract_evals_to_constant (ai. args[1 ], svec, vtypes, sv) ||
877- abstract_evals_to_constant (ai. args[1 ], tuple, vtypes, sv))
876+ if isa (tti, TypeConstructor)
877+ tti = tti. body
878+ end
879+ if isa (ai, Expr) && ai. head === :call && (abstract_evals_to_constant (ai. args[1 ], svec, vtypes, sv) ||
880+ abstract_evals_to_constant (ai. args[1 ], tuple, vtypes, sv))
878881 aa = ai. args
879882 result[i] = Any[ (isa (aa[j],Expr) ? aa[j]. typ : abstract_eval (aa[j],vtypes,sv)) for j= 2 : length (aa) ]
880883 if _any (isvarargtype, result[i])
881884 return nothing
882885 end
883- elseif isa (ti , Union)
886+ elseif isa (tti , Union)
884887 return nothing
885- elseif ti ⊑ Tuple
888+ elseif tti <: Tuple
886889 if i == n
887890 if isvatuple (tti) && length (tti. parameters) == 1
888891 result[i] = Any[Vararg{tti. parameters[1 ]. parameters[1 ]}]
@@ -894,7 +897,7 @@ function precise_container_types(args, types, vtypes::VarTable, sv)
894897 else
895898 return nothing
896899 end
897- elseif ti ⊑ AbstractArray && i== n
900+ elseif tti <: AbstractArray && i == n
898901 result[i] = Any[Vararg{eltype (tti)}]
899902 else
900903 return nothing
@@ -1264,7 +1267,7 @@ function tmerge(typea::ANY, typeb::ANY)
12641267 typea, typeb = widenconst (typea), widenconst (typeb)
12651268 typea === typeb && return typea
12661269 if (typea <: Tuple ) && (typeb <: Tuple )
1267- if length (typea. parameters) == length (typeb. parameters) && ! isvatuple (typea) && ! isvatuple (typeb)
1270+ if isa (typea, DataType) && isa (typeb, DataType) && length (typea. parameters) == length (typeb. parameters) && ! isvatuple (typea) && ! isvatuple (typeb)
12681271 return typejoin (typea, typeb)
12691272 end
12701273 return Tuple
0 commit comments