swift
ce7a0db1 - [region-isolation] Add a special error for when a closure captures a non-Sendable box.

Commit
1 year ago
[region-isolation] Add a special error for when a closure captures a non-Sendable box. The reason that I am modifying this error is that in situations like the following one can have a Sendable type that triggers this error since the box containing the value is non-Sendable. ``` func methodConsuming(x: consuming SendableKlass) async throws { try await withThrowingTaskGroup(of: Void.self) { group in group.addTask { // expected-tns-warning {{passing closure as a 'sending' parameter risks causing data races between code in the current task and concurrent execution of the closure}} useValue(x) // expected-tns-note {{closure captures reference to mutable var 'x' which is accessible to code in the current task}} } try await group.waitForAll() } } ``` rdar://133813644 (cherry picked from commit 36c2b3cc1330c07dcf9715f8ae88d31f9dba58c4)
Author
Committer
Parents
Loading