diff --git a/base/show.jl b/base/show.jl index 5341d26e4d51e..f8f83b7d9f25e 100644 --- a/base/show.jl +++ b/base/show.jl @@ -685,7 +685,7 @@ function show_delim_array(io::IO, itr, op, delim, cl, delim_one, i1=1, n=typemax while true x, state = next(itr, state) show(IOContext(recur_io, :typeinfo => - typeinfo <: Tuple ? typeinfo.parameters[i1+i0] : typeinfo), + typeinfo <: Tuple ? fieldtype(typeinfo, i1+i0) : typeinfo), x) i1 += 1 if done(itr, state) || i1 > n diff --git a/test/show.jl b/test/show.jl index ab0b971b1381c..0ffda8661e1e7 100644 --- a/test/show.jl +++ b/test/show.jl @@ -1130,6 +1130,9 @@ end # Issue #25038 A = [0.0, 1.0] @test replstr(view(A, [1], :)) == "1×1 view(::Array{Float64,2}, [1], :) with eltype Float64:\n 0.0" + + # issue #25857 + @test repr([(1,),(1,2),(1,2,3)]) == "Tuple{$Int,Vararg{$Int,N} where N}[(1,), (1, 2), (1, 2, 3)]" end @testset "#14684: `display` should print associative types in full" begin