[Concurrency] Compute the source of actor isolation in ActorIsolationRequest
.
#75668
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.
Every time I see a new project failure that says
expression is ‘async’ but not marked with ‘await’
or other actor isolation error, and the callee is notasync
or explicitly annotated with a global actor attribute, I go on a hunt for where the isolation may have been inferred from. To save time searching for the source of actor isolation inference, this change records the source of actor isolation inActorIsolationRequest
.For example:
The above code now produces the following diagnostics:
The note
main actor isolation inferred from conformance to protocol 'P'
is new with this change.This information is currently only used as an attached note to one error produced by the actor isolation checker, but this should be used in many more places. The source of actor isolation inference could also potentially be surfaced by SourceKit requests in the future.
Resolves: rdar://119905790