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

[cxx-interop] Do not create mutating properties for classes #80197

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

Xazax-hun
Copy link
Contributor

In Swift, only value types can have mutating instance member functions or computed properties. The importer logic was violating this invariant when generating setters for bit fields of shared references.

Fixes #80182

Copy link
Contributor

@egorzhdan egorzhdan left a comment

Choose a reason for hiding this comment

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

LGTM, just one question.

@Xazax-hun Xazax-hun force-pushed the gaborh/mutating-class-func branch from 305e529 to 3c37c84 Compare March 21, 2025 15:52
Copy link
Contributor

@j-hui j-hui left a comment

Choose a reason for hiding this comment

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

Looks good to me!

In Swift, only value types can have mutating instance member functions
or computed properties. The importer logic was violating this invariant
when generating setters for bit fields of shared references.

Fixes #80182
@Xazax-hun Xazax-hun force-pushed the gaborh/mutating-class-func branch from 3c37c84 to 51193fa Compare March 21, 2025 19:02
@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test

@Xazax-hun
Copy link
Contributor Author

@swift-ci please smoke test macOS

@Xazax-hun Xazax-hun merged commit 16cefca into main Mar 24, 2025
3 checks passed
@Xazax-hun Xazax-hun deleted the gaborh/mutating-class-func branch March 24, 2025 14:17
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.

[cxx-interop] Bitfield setter/getter for SWIFT_UNSAFE_REFERENCE crashes frontend
3 participants