-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[TypeChecker/NameLookup] SE-0463: A few fixes for SendableCompletionHandlers
feature
#79478
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
@swift-ci please test |
f858d63
to
bbe2e1c
Compare
@swift-ci please test |
bbe2e1c
to
7e0996c
Compare
@swift-ci please test |
@swift-ci please test Linux platform |
@swift-ci please test Linux platform |
7e0996c
to
aa1c79d
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
…` in parameter positions Just like for protocol matching, let's allow `@Sendable` mismatches in parameter positions to make sure that it's possible for header authors to add concurrency annotations without breaking clients. This is especially important for `SendableCompletionHandlers` feature that makes imported sync completion handler parameters `@Sendable`.
…s ObjC/@objc declarations When `SendableCompletionHandlers` feature is enabled, ClangImporter is going to inject `@Sendable` attribute into the completion handler parameter's function type. We need to make sure that his new behavior doesn't break shadowing rules and allow APIs to annotate their ObjC declarations with `@Sendable` without breaking clients.
aa1c79d
to
0004a4b
Compare
@swift-ci please test |
@swift-ci please test source compatibility |
@swift-ci please test source compatibility |
1 similar comment
@swift-ci please test source compatibility |
@swift-ci please test source compatibility release |
1 similar comment
@swift-ci please test source compatibility release |
@swift-ci please test source compatibility |
…esults All of the declarations returned by dynamic `AnyObject` lookup are `@objc` and hence `@preconcurrency` which means that it should be possible to introduce `@Sendable` and `any Sendable` annotations without affecting lookup and shadowing behavior.
@swift-ci please test |
332c3ca
to
15a0e5a
Compare
@swift-ci please test |
SendableCompletionHandlers
featureSendableCompletionHandlers
feature
…tnesses Witness checking itself is allowed to skip `@Sendable` mismatch in this situation. This is a narrow fix for `SendableCompletionHandlers` feature to make sure that the behavior doesn't change for non-ObjC witnesses
… on ObjC declarations Refactors `@_dynamicReplacement` attribute verification to consider only exact matches first, and if there are none, attempt to strip away sendability on ObjC declarations to make sure that any new `@Sendable` or `any Sendable` introduced to `@precocurrency` declarations don't break the overload selection.
15a0e5a
to
bb247d7
Compare
@swift-ci please test |
@swift-ci please smoke test |
Allow
@objc @implementation
to mismatch on@Sendable
in parameter positionsWarn about missing
@Sendable
annotations (even in Swift 6 language mode) to give users and developers time to adopt Swift concurrency.Shadowing: strip
@Sendable
annotations for declarations ObjC/@objc declarations to avoid ambiguities until shadowing declarations adopt@Sendable
.Strip Sendable while processing AnyObject lookup results
Allow associated type inference to skip
@Sendable
on ObjC witnessesFix
@_dynamicReplacement
to skip sendable annotations on ObjC declarationsResolves: rdar://85569247