-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Open
Open
Copy link
Labels
SILcompilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationswift 6.3
Description
Description
No response
Reproduction
class C {
func foo() {
Task {
await self.zoo()
}
}
func zoo() async {}
} 114 | Task {
| `- error: passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure [regionbasedisolation_typed_tns_passed_sending_closure]
115 | await self.zoo()
| `- note: closure captures 'self' which is accessible to code in the current task [regionbasedisolation_typed_tns_passed_to_sending_closure_helper_have_value_task_isolated]
116 | }
Expected behavior
This note is missing a hint for how to approach the problem. In other words, it does not mention what is preventing self from being safely captured — that C is not Sendable.
Environment
Swift version 6.3-dev (25bcd44)
Additional information
No response
Metadata
Metadata
Assignees
Labels
SILcompilerThe Swift compiler itselfThe Swift compiler itselfconcurrencyFeature: umbrella label for concurrency language featuresFeature: umbrella label for concurrency language featuresdiagnostics QoIBug: Diagnostics Quality of ImplementationBug: Diagnostics Quality of Implementationswift 6.3