Commit Graph

4 Commits

Author SHA1 Message Date
Michael Gottesman
16d0194d77 [sending] Improve the sending mismatch errors and make them warnings when not in swift 6.
This will ensure that we do not break anyone who has adopted APIs like
CheckedContinuation.resume that now have sending parameters.

An example of where this can come up is shown by the ProcessType in SwiftToolsCore:

```swift
@available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
@discardableResult
public func waitUntilExit() async throws -> ProcessResult {
    try await withCheckedThrowingContinuation { continuation in
        DispatchQueue.processConcurrent.async {
            self.waitUntilExit(continuation.resume(with:))
        }
    }
}
```

This fails to compile since self.waitUntilExit doesn't expect a function that
takes a sending parameter. We want to give people time to fix such issues.
2024-06-13 22:23:08 -07:00
Michael Gottesman
ba6c8afd67 Simplify test to only use target-typecheck-verify-swift since we are testing typecheck errors. 2024-06-12 16:13:05 -07:00
Michael Gottesman
3c166b5d96 [sending] Implement non-protocol function subtyping rules.
rdar://127675288
2024-06-12 16:13:05 -07:00
Michael Gottesman
1c9b1780f6 [sending] Do not let protocol function reqs with a sending result be witnessed by a function without a sending result.
This is important since the witness is not promising to return a disconnected
value and the caller of the requirement is going to accept that.

rdar://127675288
2024-06-12 16:13:05 -07:00