Skip to content

Commit 2b6bc7a

Browse files
Test CI
1 parent 69e789c commit 2b6bc7a

File tree

2 files changed

+22
-24
lines changed

2 files changed

+22
-24
lines changed

base/show.jl

+19-24
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,7 @@ function show_can_elide(p::TypeVar, wheres::Vector, elide::Int, env::SimpleVecto
695695
return true
696696
end
697697

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)
702699
n = length(env)
703700
elide = length(wheres)
704701
function egal_var(p::TypeVar, @nospecialize o)
@@ -719,31 +716,29 @@ function string_typeparams(io::IO, env::SimpleVector, orig::SimpleVector, wheres
719716
end
720717
end
721718
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)
736730
else
737-
string(p, suffix)
731+
show(io, p)
738732
end
733+
else
734+
show(io, p)
739735
end
740-
)
741-
string("{", params_string, "}")
742-
else
743-
""
736+
i < n && print(io, ", ")
737+
end
738+
print(io, "}")
744739
end
745740
resize!(wheres, elide)
746-
return s_result
741+
nothing
747742
end
748743

749744
function show_typealias(io::IO, name::GlobalRef, x::Type, env::SimpleVector, wheres::Vector)

test/stacktraces.jl

+3
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,9 @@ struct F49231{a,b,c,d,e,f,g} end
259259
@test contains(str, "[2] \e[0m\e[1m(::$F49231{Vector, Val{…}, Vector{…}, NTuple{…}, $Int, $Int, $Int})\e[22m\e[0m\e[1m(\e[22m\e[90ma\e[39m::\e[0m$Int, \e[90mb\e[39m::\e[0m$Int, \e[90mc\e[39m::\e[0m$Int\e[0m\e[1m)\e[22m\n\e[90m")
260260
end
261261

262+
@testset "type_depth_limit performance" begin
263+
end
264+
262265
@testset "Base.StackTraces docstrings" begin
263266
@test isempty(Docs.undocumented_names(StackTraces))
264267
end

0 commit comments

Comments
 (0)