Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a method to convert a
Tuple
into an equivalentStaticArray
.The memory representation is similar but not necessarily identical, so this can't be a simple cast.
StaticArray
must contain type information which is already encoded by the position in aTuple
.This conversion removes information, so it's rarely useful. One use case is for sorting, which just doesn't make sense for a
Tuple
. But turning it into aStaticArray
, it can be sorted. A use case for that in stdlib isChannel.select_impl
(#12756).I think this method should be in stdlib because it can be generally useful, even though not very common.