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

[6.0][stdlib] Optional.map, .flatMap: Remove @_disfavoredOverload #73298

Merged
merged 1 commit into from May 2, 2024

Conversation

lorentey
Copy link
Member

  • Explanation: Reverts the addition of @_disfavoredOverload on the retroactive generalizations of Optional.map and Optional.flatMap. The attribute was added speculatively to defend against potential source breaks while rdar://125016028 is being investigated; however, it leads to "expression too complex" issues that are non-hypothetical source breaks.

  • Scope: Impacts usages and external reimplementations of Optional.map and Optional.flatMap.

  • Risk: Low. This resolves regressions that have come to light, although it does potentially introduce ambiguity issues in code that have local definitions for Optional.map/.flatMap that used to shadow the originals.

  • Testing: Source compat suite.

  • Reviewer: @slavapestov

  • Main branch PR: [stdlib] Optional.map, .flatMap: Remove @_disfavoredOverload #73296

  • Issue: rdar://127015095&127015541

We don’t need this to worka round the known source compat issue, and it is triggering “expression too complex” errors, causing harm.

rdar://127015095
(cherry picked from commit 775aab0)
@lorentey
Copy link
Member Author

(Leaving it as a draft while testing is in progress.)

@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test source compatibility

@lorentey lorentey changed the title [stdlib] Optional.map, .flatMap: Remove @_disfavoredOverload [6.0][stdlib] Optional.map, .flatMap: Remove @_disfavoredOverload Apr 26, 2024
@lorentey lorentey marked this pull request as ready for review April 27, 2024 02:14
@lorentey lorentey requested a review from a team as a code owner April 27, 2024 02:14
@lorentey lorentey merged commit c45bd72 into apple:release/6.0 May 2, 2024
7 checks passed
@lorentey lorentey deleted the rdar127015095-6.0 branch May 2, 2024 21:28
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.

None yet

2 participants