File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-swift-emit-silgen -I %t -disable-availability-checking -strict-concurrency=complete -enable-experimental-feature IsolatedDefaultValues -parse-as-library %s | %FileCheck %s
2+
3+ // REQUIRES: concurrency
4+ // REQUIRES: asserts
5+
6+ @MainActor
7+ func requiresMainActor( ) -> Int { 0 }
8+
9+ @MainActor
10+ func mainActorDefaultArg( value: Int = requiresMainActor ( ) ) { }
11+
12+ // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval15mainActorCalleryyF
13+ @MainActor func mainActorCaller( ) {
14+ mainActorDefaultArg ( )
15+ }
16+
17+ // CHECK-LABEL: sil hidden [ossa] @$s30isolated_default_argument_eval22nonisolatedAsyncCalleryyYaF
18+ func nonisolatedAsyncCaller( ) async {
19+ // CHECK: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
20+ // CHECK: [[GETARG:%[0-9]+]] = function_ref @$s30isolated_default_argument_eval19mainActorDefaultArg5valueySi_tFfA_
21+ // CHECK: hop_to_executor {{.*}} : $MainActor
22+ // CHECK-NEXT: apply [[GETARG]]()
23+ // CHECK-NEXT: hop_to_executor {{.*}} : $Optional<Builtin.Executor>
24+ await mainActorDefaultArg ( )
25+ }
You can’t perform that action at this time.
0 commit comments