-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[cxx-interop] Allow specific getters/setters to be imported as comput… #65010
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
rdar://107757246 |
…ed properties. Adds `SWIFT_COMPUTED_PROPERTY`. Refs `-cxx-interop-getters-setters-as-properties`.
6d4a5fb
to
5a20d72
Compare
@swift-ci please test |
__attribute__((swift_attr("import_computed_property"))) | ||
|
||
struct Record { | ||
int getX() SWIFT_COMPUTED_PROPERTY { return 42; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you test this also applying to both getter and setter?
@zoecarver wondering how will the errors look if the attribute is used on a method with arguments? A test for that? Also, wondering if there can be name collisions when importing the two different methods using this attributes. If so, how the errors would look? |
We can add further testing after the fact on main. |
Want to get this into 5.9 asap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
IIUC if the attribute is wrongly used, it wouldn't have any effect. |
…ed properties.
Adds
SWIFT_COMPUTED_PROPERTY
. Refs-cxx-interop-getters-setters-as-properties
.