@@ -695,10 +695,7 @@ function show_can_elide(p::TypeVar, wheres::Vector, elide::Int, env::SimpleVecto
695
695
return true
696
696
end
697
697
698
- show_typeparams (io:: IO , env:: SimpleVector , orig:: SimpleVector , wheres:: Vector ) =
699
- show (io, string_typeparams (io, env, orig, wheres))
700
-
701
- function string_typeparams (io:: IO , env:: SimpleVector , orig:: SimpleVector , wheres:: Vector )
698
+ function show_typeparams (io:: IO , env:: SimpleVector , orig:: SimpleVector , wheres:: Vector )
702
699
n = length (env)
703
700
elide = length (wheres)
704
701
function egal_var (p:: TypeVar , @nospecialize o)
@@ -719,31 +716,29 @@ function string_typeparams(io::IO, env::SimpleVector, orig::SimpleVector, wheres
719
716
end
720
717
end
721
718
end
722
-
723
- s_result = if n > 0
724
- params_string = join (
725
- map (1 : n) do i
726
- p = env[i]
727
- suffix = i < n ? " , " : " "
728
- if p isa TypeVar
729
- if p. lb === Union{} && something (findfirst (@nospecialize (w) -> w === p, wheres), 0 ) > elide
730
- string (" <:" , p. ub, suffix)
731
- elseif p. ub === Any && something (findfirst (@nospecialize (w) -> w === p, wheres), 0 ) > elide
732
- string (" >:" , p. lb, suffix)
733
- else
734
- string (p, suffix)
735
- end
719
+ if n > 0
720
+ print (io, " {" )
721
+ for i = 1 : n
722
+ p = env[i]
723
+ if p isa TypeVar
724
+ if p. lb === Union{} && something (findfirst (@nospecialize (w) -> w === p, wheres), 0 ) > elide
725
+ print (io, " <:" )
726
+ show (io, p. ub)
727
+ elseif p. ub === Any && something (findfirst (@nospecialize (w) -> w === p, wheres), 0 ) > elide
728
+ print (io, " >:" )
729
+ show (io, p. lb)
736
730
else
737
- string (p, suffix )
731
+ show (io, p )
738
732
end
733
+ else
734
+ show (io, p)
739
735
end
740
- )
741
- string (" {" , params_string, " }" )
742
- else
743
- " "
736
+ i < n && print (io, " , " )
737
+ end
738
+ print (io, " }" )
744
739
end
745
740
resize! (wheres, elide)
746
- return s_result
741
+ nothing
747
742
end
748
743
749
744
function show_typealias (io:: IO , name:: GlobalRef , x:: Type , env:: SimpleVector , wheres:: Vector )
0 commit comments