Skip to content

[stdlib] Undo the generalization of Result.map & .flatMap for now #72477

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

Merged

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Mar 21, 2024

The generalization of Result.map is currently causing source compatibility issues, as map variants defined in downstream projects are no longer considered to shadow the stdlib original. (rdar://125016028)

Similar issues can affect pretty much every API generalized for ~Copyable, so the right thing to do is probably to adjust the compiler to maintain the original shadowing semantics. But for now, we can take out the cases that we see causing problems as we encounter them.

We have not generalized Optional’s map and flatMap yet, so it seems premature to do it for Result, anyway.

We didn’t do this for Optional’s equivalent methods yet, so it seems premature to do it for Result.
@lorentey lorentey requested a review from a team as a code owner March 21, 2024 01:47
@lorentey
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test source compatibility

@lorentey
Copy link
Member Author

@swift-ci test

@lorentey lorentey merged commit 3c3ef07 into swiftlang:main Mar 22, 2024
@lorentey lorentey deleted the undo-Result.map&.flatMap-generalization branch March 22, 2024 19:20
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.

1 participant