-
Notifications
You must be signed in to change notification settings - Fork 10.6k
[Concurrency] warn about 'final' on actors being ineffective #85893
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,7 @@ | |
| // REQUIRES: concurrency | ||
|
|
||
| @_expose(Cxx) | ||
| public final actor ActorWithField { | ||
| public final actor ActorWithField { // expected-warning{{'final' on actor 'ActorWithField' has no effect}} | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps we want to remove this
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, I'll follow up later adding a separate test for it. |
||
| var field: Int64 | ||
|
|
||
| public init() { | ||
|
|
||
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.
this came up somewhat recently on the forums (see here), and when i had suggested banning this, @tshortli had this to say:
given that, should this warning be further conditioned upon the declaration's access level or something?
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.
Hm ouch that's unfortunate... FYI @rjmccall
We could then make it only earn for non public declarations probably 🤔
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.
although... it should never actually be possible to inherit from an actor right (except for maybe some objc runtime trickery?)? does that mean, at least for optimized WMO builds, the vtable entries should always be removed? maybe the risk of issues in practice would be pretty low.