Skip to content

incorrect method lookup for Union{} type dispatch #55187

Closed
@vtjnash

Description

@vtjnash
julia> Base._methods_by_ftype(Tuple{Core.TypeofBottom, Vararg}, 5, Base.get_world_counter())
Any[]

julia> Type{Core.Union{}} == Core.TypeofBottom
true

julia> Base._methods_by_ftype(Tuple{Type{Core.Union{}}, Int}, 5, Base.get_world_counter())
1-element Vector{Any}:
 Core.MethodMatch(Tuple{Type{Union{}}, Int64}, svec(), Union{}(a...) @ Core boot.jl:321, true)

The Core.TypeofBottom probably often gets normalized to Type{Core.Union{}} so this doesn't get observed often, but I was noticing it leading to incorrect method invalidations during reloading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    correctness bug ⚠Bugs that are likely to lead to incorrect results in user code without throwingtypes and dispatchTypes, subtyping and method dispatch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions