Skip to content

subtyping may forget to consider tuple elements #31805

Closed

Description

julia> T = Tuple{Type{Tuple{}}, Tuple{Vararg{Int8, A}}} where A
Tuple{Type{Tuple{}}, Tuple{Vararg{Int8, A}}} where A

julia> S = Tuple{Type{Tuple{Vararg{Int32, A}}}, Tuple{Vararg{Int16, A}}} where A
Tuple{Type{Tuple{Vararg{Int32, A}}}, Tuple{Vararg{Int16, A}}} where A

julia> T <: S
true

(as trigged by running the offsetarray, arrayops, abstractarray, or missing tests with, extra sanity asserts enabled, it reports this subtyping mistake on: a = Tuple{typeof(Base.convert), Type{Tuple{}}, Tuple{Int64, Vararg{Integer, N}} where N}, b = Tuple{typeof(Base.convert), Type{Tuple{Vararg{Int64, _A}}}, Tuple{Int64, Vararg{Int64, _A}}} where _A))

equivalently:

Tuple{Type{Tuple{}}, Vararg{Int8, A}} where A
S = Tuple{Type{Tuple{Vararg{Int32, A}}}, Vararg{Int16, A}} where A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    types 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