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 {
33783378
33793379 // FIXME: CurrentContextIsolationExpr does not have its actor set
33803380 // 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+ }
33813387 if (auto *macro = dyn_cast<MacroExpansionExpr>(arg)) {
33823388 auto *expansion = macro->getRewritten ();
33833389 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 {
477477func invalidIsolatedClosureParam< A: AnyActor> (
478478 _: ( isolated A) async throws -> Void // expected-error {{'isolated' parameter type 'A' does not conform to 'Actor' or 'DistributedActor'}}
479479) { }
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