Skip to content

[cxx-interop] Drop return values of +=, -=, *=, /= #61543

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
merged 1 commit into from
Oct 13, 2022

Conversation

egorzhdan
Copy link
Contributor

These operators return Void in Swift, let's drop the return type of these operators when importing them from C++.

This is needed for the upcoming UnsafeCxxRandomAccessIterator protocol: if a protocol declares func += returning Void, but the implementation non-Void, that causes a typechecker error.

@egorzhdan egorzhdan added the c++ interop Feature: Interoperability with C++ label Oct 11, 2022
@egorzhdan egorzhdan requested review from hyp and zoecarver October 11, 2022 14:41
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-drop-return-type branch from 15f026c to 0de694f Compare October 11, 2022 15:29
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

Copy link
Contributor

@zoecarver zoecarver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

These operators return `Void` in Swift, let's drop the return type of these operators when importing them from C++.

This is needed for the upcoming `UnsafeCxxRandomAccessIterator` protocol: if a protocol declares `func +=` returning `Void`, but the implementation non-`Void`, that causes a typechecker error.
@egorzhdan egorzhdan force-pushed the egorzhdan/cxx-drop-return-type branch from 0de694f to 954e740 Compare October 11, 2022 16:59
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

This is a requirement for #61554

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test macOS

@egorzhdan egorzhdan merged commit 45b8c1e into main Oct 13, 2022
@egorzhdan egorzhdan deleted the egorzhdan/cxx-drop-return-type branch October 13, 2022 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants