Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle unions of tuples better #22051

Closed
vtjnash opened this issue May 24, 2017 · 1 comment
Closed

handle unions of tuples better #22051

vtjnash opened this issue May 24, 2017 · 1 comment
Labels
types and dispatch Types, subtyping and method dispatch

Comments

@vtjnash
Copy link
Sponsor Member

vtjnash commented May 24, 2017

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)
@vtjnash
Copy link
Sponsor Member Author

vtjnash commented Mar 29, 2022

most of these are deprecated now and written better

@vtjnash vtjnash closed this as completed Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types and dispatch Types, subtyping and method dispatch
Projects
None yet
Development

No branches or pull requests

2 participants