File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -3378,6 +3378,12 @@ namespace {
3378
3378
3379
3379
// FIXME: CurrentContextIsolationExpr does not have its actor set
3380
3380
// at this point.
3381
+ if (auto *defaultArg = dyn_cast<DefaultArgumentExpr>(arg)) {
3382
+ // Look through caller-side default arguments for #isolation.
3383
+ if (defaultArg->isCallerSide ()) {
3384
+ arg = defaultArg->getCallerSideDefaultExpr ();
3385
+ }
3386
+ }
3381
3387
if (auto *macro = dyn_cast<MacroExpansionExpr>(arg)) {
3382
3388
auto *expansion = macro->getRewritten ();
3383
3389
if (auto *isolation = dyn_cast<CurrentContextIsolationExpr>(expansion)) {
Original file line number Diff line number Diff line change @@ -477,3 +477,11 @@ nonisolated func fromNonisolated(ns: NotSendable) async -> NotSendable {
477
477
func invalidIsolatedClosureParam< A: AnyActor> (
478
478
_: ( isolated A) async throws -> Void // expected-error {{'isolated' parameter type 'A' does not conform to 'Actor' or 'DistributedActor'}}
479
479
) { }
480
+
481
+ public func useDefaultIsolation(
482
+ _ isolation : isolated ( any Actor) ? = #isolation
483
+ ) { }
484
+
485
+ @MainActor func callUseDefaultIsolation( ) async {
486
+ useDefaultIsolation ( )
487
+ }
You can’t perform that action at this time.
0 commit comments