mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user