expr for global actors.
This eliminates a crash when type checking `#isolation` expansions
for global actors nested in other types, because the `TypeExpr`
does not properly represent the type repr for nested types. It's
simpler to provide the type directly instead of going through type
resolution.
mismatch.
The actor isolation checker was setting the actor value for
`#isolation` when type checking the expression failed. Later on, the
isolation checker would crash when querying the type of the actor, e.g.
to check if it's a distributed actor. Instead, keep the actor value as
null if there's a type mismatch.
Macro expansions are never considered implicit. They have
valid source locations in their macro expansion buffer, they
do not cause implicit 'self' capture diagnostics, etc. This
fixes an issue where existing code that iterates over an async
sequence in an escaping closure would diagnose a use of implicit
'self' via the '#isolation' argument to 'next()'.
Introduce a new expression macro that produces an value of type
`(any AnyActor)?` that describes the current actor isolation. This
isolation will be `nil` in non-isolated code, and refer to either the
actor instance of shared global actor in other cases.
This is currently behind the experimental feature flag
OptionalIsolatedParameters.