Skip to content

incorrect dispatch trying to print Union{} Type #55208

@vtjnash

Description

@vtjnash

This possibly goes along with the broader prohibition that against overloading show for Type, as this is equivalent to type-piracy in Base. But we should fix the definition or the type-intersection bug that causes this dispatch error:

julia> string((Core.Union{}, true, true, true))
ERROR: TypeError: in typeassert, expected UnionAll, got Type{Union{}}
Stacktrace:
 [1] _show_type(io::IOContext{IOBuffer}, x::Type)
   @ Base ./show.jl:989
 [2] show(io::IOContext{IOBuffer}, x::Type)
   @ Base ./show.jl:970
 [3] show_delim_array(io::IOBuffer, itr::Tuple{Core.TypeofBottom, Bool, Bool, Bool}, op::Char, delim::Char, cl::Char, delim_one::Bool, i1::Int64, n::Int64)
   @ Base ./show.jl:1440
 [4] show_delim_array
   @ ./show.jl:1425 [inlined]
 [5] show
   @ ./show.jl:1458 [inlined]
 [6] print(io::IOBuffer, x::Tuple{Core.TypeofBottom, Bool, Bool, Bool})
   @ Base ./strings/io.jl:35
 [7] print_to_string(xs::Tuple{Core.TypeofBottom, Bool, Bool, Bool})
   @ Base ./strings/io.jl:148
 [8] string(xs::Tuple{Core.TypeofBottom, Bool, Bool, Bool})
   @ Base ./strings/io.jl:189
 [9] top-level scope
   @ REPL[4]:1

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler:codegenGeneration of LLVM IR and native codecorrectness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingregression 1.10Regression in the 1.10 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions