[concurrency] type-checking global-actor-isolated references in ordinary functions #35048
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Non-actor isolated synchronous functions were mistakenly allowed to call & reference global-actor isolated declarations:
There are two invalid references to global-actor isolated declarations. There are various ways to fix such problems:
ordinaryFunc
as@asyncHandler
ordinaryFunc
asasync
ordinaryFunc
part of the global-actor thatsyncGlobActorFn
belongs to.We only suggest fix (3) if the incorrect global-actor reference is not part of an apply (i.e., reference B). For reference A, which directly applies the function, we suggest all 3 as possible fixes.
Thus, in terms of new fix-its: If the caller is not associated with an actor and is a synchronous function that refers to a global-actor isolated declaration, we will suggest the option of making that synchronous function part of the global-actor's context (fixing rdar://71698464). We do not suggest becoming part of the global-actor if the reference appears in an async context.
Resolves rdar://71548470&71698464
TODOs: