-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[ConstraintSystem] InferSendableFromCaptures: Mark unapplied operator references as @Sendable
#76136
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
Apparently expressions like |
@swift-ci please test |
… references as `@Sendable` Both of these functions are single-apply instance members, even though their names could be compound the application is still a regular call with like `next(isolation: ...)` vs. `next(isolation:)(...)` it would have to be for a "compound" application. Operator references don't have a base type and could be found via unqualified lookup, `adjustFunctionTypeForConcurrency` should handle them specifically. Resolves: rdar://131321053
…` for for-in loops
@swift-ci please test |
@swift-ci please test source compatibility |
…Levels` to detect partial applications We used to detect partial applications based on member locators and parent expressions, but using function reference kind + check to see if self is applied is such simpler and hits both uses of `isPartialApplication`.
@swift-ci please test |
@swift-ci please test source compatibility |
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.
Looks great, thank you!
…ly applied instance methods on non-Sendable base In situations like: ``` class A { func test() {} } ``` Fully uncurried function type should be @sendable but inner method cannot be because it captures a non-Sendable type `A` when applied.
@swift-ci please test |
@swift-ci please test source compatibility |
Operator references don't have a base type and could be found via
unqualified lookup,
adjustFunctionTypeForConcurrency
should handlethem specifically.
Resolves: rdar://131321053