-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[Concurrency] Fix a crash caused by misuse of isolated
modifier
#82593
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
Adjust isolation checking to handle misused `isolated` attribute and let attribute checker property diagnose it. Resolves: rdar://148076903 Resolves: swiftlang#80363
@swift-ci please test |
@swift-ci please test macOS platform |
@swift-ci please test Windows platform |
|
||
func testLocal() { | ||
isolated let c = C() | ||
// expected-error@-1 {{'isolated' may only be used on 'deinit' declarations}} |
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.
the error message isn't quite right. it may also be used on parameters today: func p(a: isolated A)
where A
is an : Actor
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.
Right, this is just a crash fix, we can adjust the message separately.
class C {} | ||
|
||
func testLocal() { | ||
isolated let c = C() |
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.
Note that in the future we'd actually want to support that kinda, in those cases:
func p(pp: isolated P) {
isolated let c = pp // carry "forward" that it was isolated
}
Adjust isolation checking to handle misused
isolated
attribute and let attribute checker property diagnose it.Resolves: rdar://148076903
Resolves: #80363