Skip to content

[TypeChecker] InferSendableFromCaptures: Infer @Sendable on adjusted types #72527

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

Merged
merged 5 commits into from
Mar 29, 2024

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Mar 22, 2024

Previously sendability was inferred directly on an (opened) interface type and
carried over to the "adjusted" type, this creates a problem for some partially
applied references to isolated members because they have to be wrapped in an
autoclosure that would attempt a conversion from i.e. @Sendable to @MainActor
type and be diagnosed an a concurrency issue.

Instead of doing that let's apply inference to the adjusted type, which maintains
original behavior where (opened) interface type is adjusted via FunctionConversionExpr
to a type with appropriate concurrency annotations.

Resolves: rdar://119593407

xedin added 5 commits March 20, 2024 13:16
…e `FunctionType`

This method is always called after the type is opened by the solver
which means that we never end up with `GenericFunctionType`.
…nversions

None of the diagnostics in MiscDiagnostics make a distinction between
sendable or actor-isolated function references which means that we can
skip conversions while reaching for a declaration used in an application.
…bers to `adjustFunctionTypeForConcurrency`
@xedin
Copy link
Contributor Author

xedin commented Mar 22, 2024

@swift-ci please test

@xedin xedin requested a review from angela-laar March 28, 2024 16:15
@xedin
Copy link
Contributor Author

xedin commented Mar 28, 2024

@swift-ci please test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants