Skip to content

Commit

Permalink
fix #25857, typeinfo problem in showing arrays with abstract tuple …
Browse files Browse the repository at this point in the history
…types (#26289)
  • Loading branch information
JeffBezanson authored Mar 2, 2018
1 parent df489f0 commit d1f2678
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions test/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d1f2678

Please sign in to comment.