Strange bug on v0.7 master, trying to display a `Vector{Tuple{String, Vector{String}}}`

julia> books
13-element Array{Tuple{String,Array{String,1}},1}:
Error showing value of type Array{Tuple{String,Array{String,1}},1}:
ERROR: AssertionError: Array{String,1} is not a subtype of Tuple{String,Array{String,1}}
Stacktrace:
 [1] typeinfo_prefix(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{String,1}) at ./arrayshow.jl:480
 [2] show_vector(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{String,1}, ::Char, ::Char) at ./arrayshow.jl:433 (repeats 2 times)
 [3] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{String,1}) at ./arrayshow.jl:447
 [4] show_delim_array(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Tuple{String,Array{String,1}}, ::Char, ::Char, ::Char, ::Bool, ::Int64, ::Int64) at ./show.jl:501
 [5] show_delim_array at ./show.jl:489 [inlined]
 [6] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Tuple{String,Array{String,1}}) at ./show.jl:517
 [7] #sprint#283(::IOContext{Base.Terminals.TTYTerminal}, ::Int64, ::Function, ::Function, ::Tuple{String,Array{String,1}}, ::Vararg{Tuple{String,Array{String,1}},N} where N) at ./strings/io.jl:89
 [8] #sprint at ./<missing>:0 [inlined]
 [9] alignment at ./show.jl:1586 [inlined]
 [10] alignment(::IOContext{Base.Terminals.TTYTerminal}, ::Array{Tuple{String,Array{String,1}},1}, ::Base.OneTo{Int64}, ::Base.OneTo{Int64}, ::Int64, ::Int64, ::Int64) at ./arrayshow.jl:68
 [11] print_matrix(::IOContext{Base.Terminals.TTYTerminal}, ::Array{Tuple{String,Array{String,1}},1}, ::String, ::String, ::String, ::String, ::String, ::String, ::Int64, ::Int64) at ./arrayshow.jl:187
 [12] print_matrix at ./arrayshow.jl:160 [inlined]
 [13] print_array at ./arrayshow.jl:309 [inlined]
 [14] _display(::IOContext{Base.Terminals.TTYTerminal}, ::Array{Tuple{String,Array{String,1}},1}) at ./arrayshow.jl:345
 [15] show(::IOContext{Base.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::Array{Tuple{String,Array{String,1}},1}) at ./replutil.jl:139
 [16] display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::Array{Tuple{String,Array{String,1}},1}) at ./repl/REPL.jl:126
 [17] display(::Base.REPL.REPLDisplay{Base.REPL.LineEditREPL}, ::Array{Tuple{String,Array{String,1}},1}) at ./repl/REPL.jl:129
 [18] display(::Array{Tuple{String,Array{String,1}},1}) at ./multimedia.jl:291
 [19] (::getfield(Base, Symbol("#inner#4")){NamedTuple{(),Tuple{}},typeof(display),Tuple{Array{Tuple{String,Array{String,1}},1}}})() at ./essentials.jl:665
 [20] #invokelatest#3 at ./essentials.jl:666 [inlined]
 [21] invokelatest at ./essentials.jl:665 [inlined]
 [22] print_response(::Base.Terminals.TTYTerminal, ::Any, ::Void, ::Bool, ::Bool, ::Void) at ./repl/REPL.jl:147
 [23] print_response(::Base.REPL.LineEditREPL, ::Any, ::Void, ::Bool, ::Bool) at ./repl/REPL.jl:133
 [24] (::getfield(Base.REPL, Symbol("#do_respond#17")){Bool,getfield(Base.REPL, Symbol("##27#38")){Base.REPL.LineEditREPL,Base.REPL.REPLHistoryProvider},Base.REPL.LineEditREPL,Base.LineEdit.Prompt})(::Base.LineEdit.MIState, ::Base.GenericIOBuffer{Array{UInt8,1}}, ::Bool) at ./repl/REPL.jl:708
 [25] top-level scope

julia> typeof(books)
Array{Tuple{String,Array{String,1}},1}

julia> books[1]
("Russian.txt", ["СЕРГЕЙ ГОЛОВАЧЁВ", "ЛЫСАЯ ГОРА ДЕВИЧЬЯ", "МИСТИЧЕСКИЙ ТРИЛЛЕР", "НАПУТСТВИЕ", "Лысых гор на свете немало. Чуть ли не в каждом городе есть своя Лысая. Даже там, где нет гор.", ...

Note: this works correctly (although with some reason extraneous blank lines between elements) on v0.6.1.

https://github.com/JuliaLang/julia/issues/25042, https://github.com/JuliaLang/julia/pull/25043

1 Like