[Concurrency] Allow default arguments to require actor isolation.

Type checking a default argument expression will compute the required
actor isolation for evaluating that argument value synchronously. Actor
isolation checking is deferred to the caller; it is an error to use a
default argument from across isolation domains.

Currently gated behind -enable-experimental-feature IsolatedDefaultArguments.
This commit is contained in:
Holly Borla
2023-09-26 12:26:42 -07:00
committed by Holly Borla
parent 57f08da518
commit 95a7107872
13 changed files with 276 additions and 2 deletions

View File

@@ -6415,6 +6415,11 @@ public:
/// at the call site in order to have the correct context information.
Expr *getTypeCheckedDefaultExpr() const;
/// The actor isolation required of the caller in order to use the
/// default argument for this parameter. If the required isolation is
/// not met, an argument must be written explicitly at the call-site.
ActorIsolation getDefaultArgumentIsolation() const;
/// Retrieve the potentially un-type-checked default argument expression for
/// this parameter, which can be queried for information such as its source
/// range and textual representation. Returns \c nullptr if there is no