@@ -727,11 +727,11 @@ function show_typealias(io::IO, @nospecialize(x::Type))
727727end
728728
729729function make_typealiases (@nospecialize (x:: Type ))
730- Any === x && return Core. svec (), Union{}
731- x <: Tuple && return Core. svec (), Union{}
730+ aliases = SimpleVector[]
731+ Any === x && return aliases, Union{}
732+ x <: Tuple && return aliases, Union{}
732733 mods = modulesof! (Set {Module} (), x)
733734 Core in mods && push! (mods, Base)
734- aliases = SimpleVector[]
735735 vars = Dict {Symbol,TypeVar} ()
736736 xenv = UnionAll[]
737737 each = Any[]
@@ -783,23 +783,24 @@ function make_typealiases(@nospecialize(x::Type))
783783 end
784784 end
785785 if isempty (aliases)
786- return Core . svec () , Union{}
786+ return aliases , Union{}
787787 end
788- sort! (aliases, by = x -> x[4 ], rev = true ) # heuristic sort by "best" environment
788+ sort! (aliases, by = x -> x[4 ]:: Tuple{Int,Int} , rev = true ) # heuristic sort by "best" environment
789789 let applied = Union{}
790790 applied1 = Union{}
791791 keep = SimpleVector[]
792792 prev = (0 , 0 )
793793 for alias in aliases
794- if alias[4 ][1 ] < 2
794+ alias4 = alias[4 ]:: Tuple{Int,Int}
795+ if alias4[1 ] < 2
795796 if ! (alias[3 ] <: applied )
796797 applied1 = Union{applied1, alias[3 ]}
797798 push! (keep, alias)
798799 end
799- elseif alias[ 4 ] == prev || ! (alias[3 ] <: applied )
800+ elseif alias4 == prev || ! (alias[3 ] <: applied )
800801 applied = applied1 = Union{applied1, alias[3 ]}
801802 push! (keep, alias)
802- prev = alias[ 4 ]
803+ prev = alias4
803804 end
804805 end
805806 return keep, applied1
@@ -825,16 +826,17 @@ function show_unionaliases(io::IO, x::Union)
825826 end
826827 if first && ! tvar && length (aliases) == 1
827828 alias = aliases[1 ]
828- wheres = make_wheres (io, alias[2 ], x)
829- show_typealias (io, alias[1 ], x, alias[2 ], wheres)
829+ env = alias[2 ]:: SimpleVector
830+ wheres = make_wheres (io, env, x)
831+ show_typealias (io, alias[1 ], x, env, wheres)
830832 show_wheres (io, wheres)
831833 else
832834 for alias in aliases
833835 print (io, first ? " Union{" : " , " )
834836 first = false
835- env = alias[2 ]
836- wheres = make_wheres (io, alias[ 2 ] , x)
837- show_typealias (io, alias[1 ], x, alias[ 2 ] , wheres)
837+ env = alias[2 ]:: SimpleVector
838+ wheres = make_wheres (io, env , x)
839+ show_typealias (io, alias[1 ], x, env , wheres)
838840 show_wheres (io, wheres)
839841 end
840842 if tvar
879881show (io:: IO , @nospecialize (x:: Type )) = _show_type (io, inferencebarrier (x))
880882function _show_type (io:: IO , @nospecialize (x:: Type ))
881883 if print_without_params (x)
882- show_type_name (io, unwrap_unionall (x). name)
884+ show_type_name (io, ( unwrap_unionall (x) :: DataType ). name)
883885 return
884886 elseif get (io, :compact , true ) && show_typealias (io, x)
885887 return
@@ -1006,7 +1008,7 @@ function show_datatype(io::IO, x::DataType, wheres::Vector{TypeVar}=TypeVar[])
10061008 end
10071009 else
10081010 show_type_name (io, x. name)
1009- show_typeparams (io, parameters, unwrap_unionall (x. name. wrapper). parameters, wheres)
1011+ show_typeparams (io, parameters, ( unwrap_unionall (x. name. wrapper) :: DataType ). parameters, wheres)
10101012 end
10111013end
10121014
0 commit comments