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-13883] StrideToIterator and StrideThroughIterator are broken #56281

Closed
swift-ci opened this issue Nov 20, 2020 · 2 comments
Closed

[SR-13883] StrideToIterator and StrideThroughIterator are broken #56281

swift-ci opened this issue Nov 20, 2020 · 2 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella

Comments

@swift-ci
Copy link
Collaborator

Previous ID SR-13883
Radar None
Original Reporter valeriyvan (JIRA User)
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug
Assignee @xwu
Priority Medium

md5: 2985aea46af20ed17bd5219fe464794f

duplicates:

  • SR-2016 stride(from:0 as UInt8, though: 255, by: 2) should not trap.

relates to:

  • SR-14325 Support Strideable on finite enums.

Issue Description:

These crash:

let a = Array(stride(from: 0, through: Int8.max, by: 3))

let b = Array(stride(from: 0, to: Int8.max, by: 3))

Both struct StrideToIterator<Element: Strideable> and struct StrideThroughIterator<Element: Strideable> are broken. The latter could be fixed thanks for having internal _didReturnEnd property. But for struct StrideToIterator<Element: Strideable> which doesn't have such property, I don't see a nice way to fix this bug. Both these structs are frozen.

This PR #34845 extends validation test to show bug.

@xwu
Copy link
Collaborator

xwu commented Nov 21, 2020

Fixed in PR#34860.

@typesanitizer
Copy link

Temporarily re-opening. We can mark it resolved when the PR is merged after Thanksgiving.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

3 participants