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

[SR-1959] Use Bounds.Stride for Index on countable ranges #44568

Open
gribozavr opened this issue Jul 1, 2016 · 0 comments
Open

[SR-1959] Use Bounds.Stride for Index on countable ranges #44568

gribozavr opened this issue Jul 1, 2016 · 0 comments
Labels
affects ABI Flag: Affects ABI good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal

Comments

@gribozavr
Copy link
Collaborator

Previous ID SR-1959
Radar rdar://problem/26302563
Original Reporter @gribozavr
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, AffectsABI, StarterProposal, swift-evolution-proposal-needed
Assignee None
Priority Medium

md5: 6a8b1ccf3e51e9239df2d35454f79393

Issue Description:

CountableRange collection conformance defines an Index type that conforms to Strideable. That is not the case for the CountableClosedRange, which makes the two ranges not interchangeable in all cases.

ClosedRangeIndex implementation uses an internal enum that makes Strideable conformance hard to implement.

The proposed solution is to use Bounds.Stride as Index on both CountableRange and CountableClosedRange.

  • It is proposed to use `Bound.Stride` as index for both countable ranges.

  • The only problem with that is that `SubSequence` of a countable range can no longer be the same type (as indices will not be interchangeable). [Why is this? Someone needs to reconstruct the logic chain.]

  • But it can be solved by using one of the existing slice types for `SubSequence`.

NOTE: Requires a swift-evolution proposal.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added improvement good first issue Good for newcomers and removed bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. StarterProposal labels Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects ABI Flag: Affects ABI good first issue Good for newcomers improvement standard library Area: Standard library umbrella swift evolution proposal needed Flag → feature: A feature that warrants a Swift evolution proposal
Projects
None yet
Development

No branches or pull requests

2 participants