Skip to content

Add @discardableResult to Data.WritingOptions concrete implementations#1856

Merged
jmschonfeld merged 1 commit intoswiftlang:mainfrom
jmschonfeld:writing-options-discardable-result
Mar 27, 2026
Merged

Add @discardableResult to Data.WritingOptions concrete implementations#1856
jmschonfeld merged 1 commit intoswiftlang:mainfrom
jmschonfeld:writing-options-discardable-result

Conversation

@jmschonfeld
Copy link
Copy Markdown
Contributor

Adds missing @discardableResult annotations to the new concrete implementations of Data.WritingOptions SetAlgebra APIs

Motivation:

Some SetAlgebra APIs that I recently implemented in Data.WritingOptions had @discardableResult but my implementations are missing that annotation. This means that callers start seeing warnings when discarding the result that were not present before.

Modifications:

Add @discardableResult to the new implementations

Result:

Clients no longer see warnings when discarding the result of these functions

Testing:

It is not possible to test for the presence of this specific warning in a unit test, this change has been manually tested

@jmschonfeld jmschonfeld requested a review from a team as a code owner March 26, 2026 23:15
@jmschonfeld
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

@jmschonfeld jmschonfeld merged commit dccc687 into swiftlang:main Mar 27, 2026
22 checks passed
@jmschonfeld jmschonfeld deleted the writing-options-discardable-result branch March 27, 2026 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants