Skip to content

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

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

Conversation

lorentey
Copy link
Member

(This is a cherry pick of #72477.)

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
Copy link
Member Author

@swift-ci test

@lorentey
Copy link
Member Author

@swift-ci test source compatibility

@lorentey
Copy link
Member Author

(Apologies for the review request noise, everyone! I initially set the wrong target branch.)

@lorentey
Copy link
Member Author

@swift-ci test

@lorentey lorentey merged commit 5afa19c into swiftlang:release/6.0 Mar 22, 2024
@lorentey lorentey deleted the undo-Result.map&.flatMap-generalization-6.0 branch March 22, 2024 19:21
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