[SE-0525] remove default parameters from load and storeBytes#3260
Open
glessard wants to merge 28 commits intoswiftlang:mainfrom
Open
[SE-0525] remove default parameters from load and storeBytes#3260glessard wants to merge 28 commits intoswiftlang:mainfrom
glessard wants to merge 28 commits intoswiftlang:mainfrom
Conversation
- Add an “alternatives considered” paragraph
The original label “elements” seems like it’s a container, rather than a count. `elementCount` is obviously a count of elements.
13c5d27 to
5d75c47
Compare
It was `bytes` by mistake, but the fix disappeared the argument label when it should be the same as the parameter label.
This property exists on RawSpan and MutableRawSpan, and is useful to iterate over the initialized contents of the span.
xwu
reviewed
Apr 29, 2026
Contributor
xwu
left a comment
There was a problem hiding this comment.
Nice clean-ups!
I discussed the API-level bugfixes with the group. They pointed out that we have slightly different spellings for append(elementCount:...) here versus append(addingCount:...) for the in-flight UniqueArray and RigidArray that should probably be reconciled, so I'll merge with acceptance and prompt the community for a focused mini-review on the API bugfixes (the remaining ones being pretty uncontroversial).
xwu
reviewed
Apr 29, 2026
| subscript(unchecked byteOffset: Int) -> UInt8 { get set } | ||
|
|
||
| /// The offsets valid for subscripting the span, in ascending order. | ||
| public var byteOffsets: Range<Int> |
Contributor
Author
There was a problem hiding this comment.
Yes. RawSpan and MutableRawSpan already had this property, so this was a gap.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Remove default parameters, from
loadandstoreBytesfunctions, as discussed in the LSG proposal acceptance meeting.Add an “alternatives considered” paragraph to document this.
Added a missing "Implications on adoption" section.
Fixed many inconsistencies in doc-comments and between sections.
Had erroneously proposed
@unsafeattribute on conformances, instead of@unchecked.Had erroneously proposed an argument label of
MutableSpan.init(bytes: MutableRawSpan)insteadMutableSpan.init(mutableBytes: MutableRawSpan).The first argument label of
OutputSpan.append(elements: Int, initializingWith: (OutputRawSpan) -> R)is changed toelementCountfor clarity.