Bug in julia 0.7


#1
  | | |_| | | | (_| |  |  Version 0.7.0-beta.0 (2018-06-24 01:32 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release
|__/                   |  x86_64-pc-linux-gnu

julia> map(values,[Dict(:a=>1),Dict(:b=>2)])
2-element Array{Base.ValueIterator{Dict{Symbol,Int64}},1}:
Error showing value of type Array{Base.ValueIterator{Dict{Symbol,Int64}},1}:
ERROR: AssertionError: Array{Int64,1} is not a subtype of Base.ValueIterator{Dict{Symbol,Int64}}
Stacktrace:
 [1] typeinfo_prefix(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{Int64,1}) at ./arrayshow.jl:477
 [2] show_vector(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Array{Int64,1}, ::Char, ::Char) at ./arrayshow.jl:431 (repeats 2 times)
 [3] show at ./arrayshow.jl:417 [inlined]
 [4] show(::IOContext{Base.GenericIOBuffer{Array{UInt8,1}}}, ::Base.ValueIterator{Dict{Symbol,Int64}}) at ./abstractdict.jl:50
 [5] #sprint#330(::IOContext{REPL.Terminals.TTYTerminal}, ::Int64, ::Function, ::Function, ::Base.ValueIterator{Dict{Symbol,Int64}}) at ./strings/io.jl:97
 [6] #sprint at ./array.jl:0 [inlined]
 [7] alignment at ./show.jl:1719 [inlined]
 [8] alignment(::IOContext{REPL.Terminals.TTYTerminal}, ::Array{Base.ValueIterator{Dict{Symbol,Int64}},1}, ::Base.OneTo{Int64}, ::Base.OneTo{Int64}, ::Int64, ::Int64, ::Int64) at ./arrayshow.jl:68
 [9] print_matrix(::IOContext{REPL.Terminals.TTYTerminal}, ::Array{Base.ValueIterator{Dict{Symbol,Int64}},1}, ::String, ::String, ::String, ::String, ::String, ::String, ::Int64, ::Int64) at ./arrayshow.jl:186
 [10] print_matrix at ./arrayshow.jl:159 [inlined]
 [11] print_array at ./arrayshow.jl:308 [inlined]
 [12] show(::IOContext{REPL.Terminals.TTYTerminal}, ::MIME{Symbol("text/plain")}, ::Array{Base.ValueIterator{Dict{Symbol,Int64}},1}) at ./arrayshow.jl:344
 [13] display(::REPL.REPLDisplay{REPL.LineEditREPL}, ::MIME{Symbol("text/plain")}, ::Array{Base.ValueIterator{Dict{Symbol,Int64}},1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v0.7/REPL/src/REPL.jl:130

#2

Looks like a problem with the new typeinfo machinery. Cc: @rfourquet


#3

The bug is only in the display code and also manifests in e.g.

julia> [keys(Dict(1=>1))]
1-element Array{Base.KeySet{Int64,Dict{Int64,Int64}},1}:
Error showing value of type Array{Base.KeySet{Int64,Dict{Int64,Int64}},1}:
ERROR: AssertionError: Array{Int64,1} is not a subtype of Base.KeySet{Int64,Dict{Int64,Int64}}

#4

Thanks, I’m on it! I think it’s the same bug as in an already opened julia issue, that I started to work on.