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-2624] ArraySlice trap messages shouldn't complain about negative indices #45229

Closed
gribozavr opened this issue Sep 13, 2016 · 3 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. good first issue Good for newcomers standard library Area: Standard library umbrella

Comments

@gribozavr
Copy link
Collaborator

Previous ID SR-2624
Radar rdar://problem/22873701
Original Reporter @gribozavr
Type Bug
Status Resolved
Resolution Done
Additional Detail from JIRA
Votes 0
Component/s Standard Library
Labels Bug, StarterBug
Assignee sigito (JIRA)
Priority Medium

md5: 7ed9fb862350197272a4c79b7ced41d6

Issue Description:

These trap messages shouldn’t say “negative”, that’s not correct for ArraySlice:

$ git grep -i negative stdlib/public/core/ | grep -i out
stdlib/public/core/Arrays.swift.gyb:    _precondition(index >= startIndex, "Negative ${Self} index is out of range")
stdlib/public/core/SliceBuffer.swift:    _sanityCheck(i >= startIndex, "negative slice index is out of range")
stdlib/public/core/SliceBuffer.swift:      _sanityCheck(position >= startIndex, "negative slice index is out of range")
@swift-ci
Copy link
Collaborator

Comment by Yura Samsoniuk (JIRA)

Is the problem just in an error message wording? It partially makes sense for ContiguousArray, which is generated with Arrays.swift.gyb template, together with ArraySlice. Would it be good enough to just remove "Negative" from the message?

@gribozavr
Copy link
Collaborator Author

Yes, only the wording is an issue. The check itself is correct.

@swift-ci
Copy link
Collaborator

Comment by Yura Samsoniuk (JIRA)

#4795

@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. good first issue Good for newcomers standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants