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

Add missing cases for Tuple.{Head, Tail, Init, Last} #19230

Closed

Conversation

nicolasstucki
Copy link
Contributor

All these cases take as input a Tuple but did not handle the empty case.

All these cases take as input a `Tuple` but did not handle the empty
case.
@nicolasstucki nicolasstucki marked this pull request as ready for review December 11, 2023 10:46
@sjrd
Copy link
Member

sjrd commented Dec 11, 2023

I think that was on purpose. We typically want a compile error when trying to get the head of an empty tuple type; not a Nothing.

@nicolasstucki
Copy link
Contributor Author

This makes more sense in the context of #19185. There we can end up with tup.head of an empty tuple after some steps of reduction. The error that is shown by the match type is worse than the one we can emit in the tuple optimization phase.

Maybe I should do all these changes together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants