Skip to content

UnionAll types violate observational equivalence for egal (===) objects #53593

Open
@topolarity

Description

@topolarity
julia> T1 = TypeVar(:T);
julia> T2 = TypeVar(:T);
julia> TT1 = UnionAll(T1, Tuple{T1})
Tuple{T} where T

julia> TT2 = UnionAll(T2, Tuple{T2})
Tuple{T} where T

julia> TT1 === TT2
true

For these types, Base.unwrap_unionall is clearly non consistent but is marked as such:

julia> Base.unwrap_unionall(TT1) === Base.unwrap_unionall(TT2)
false

julia> Base.infer_effects(Base.unwrap_unionall, (Type{TT1},))
(+c,+e,+n,+t,+s,+m,+u)

Metadata

Metadata

Assignees

No one assigned

    Labels

    equalityIssues relating to equality relations: ==, ===, isequaltypes 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