Skip to content

counterexample for subtyping transitivity involving types of types #57754

Open
@nsajko

Description

@nsajko
julia> a = Type{Tuple{UnitRange{Int64}, Symbol, X} where {X}}
Type{Tuple{UnitRange{Int64}, Symbol, X} where X}

julia> b = Type{Tuple{UnitRange{Int64}, Symbol, Any}}
Type{Tuple{UnitRange{Int64}, Symbol, Any}}

julia> c = DataType
DataType

julia> a <: b
true

julia> a <: c
false

julia> b <: a
true

julia> b <: c
true

julia> c <: a
false

julia> c <: b
false

So we have (a <: b) && (b <: c), but !(a <: c).

See also comments by @topolarity here: #57631 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    types and dispatchTypes, subtyping and method dispatch

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions