Skip to content

handle unions of tuples better #22051

@vtjnash

Description

@vtjnash

It seems that many of our tuple-type manipulation functions in Base (eltype, tuple_type_cons, tuple_type_tail, tuple_type_head) assume that Tuples can't be put into Unions. This is rather silly.

Many of these also seem to be unnecessarily marked as @pure, when it may be possible to write them more succinctly in a way that inference can optimize much more effectively than just simply being pure:

tuple_type_head(TT::Type) = fieldtype(TT::Type{<:Tuple}, 1)

Metadata

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