mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The witness thunk is async which means that it needs a hop to the expected concurrency domain imposed by the requirement otherwise it says in the caller's domain. Resolves: https://github.com/apple/swift/issues/62394 Resolves: rdar://121415906
22 lines
889 B
Swift
22 lines
889 B
Swift
// RUN: %target-swift-frontend -disable-availability-checking -emit-silgen -verify %s | %FileCheck %s
|
|
// RUN: %target-swift-frontend -disable-availability-checking -emit-silgen -verify -strict-concurrency=complete %s | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
// REQUIRES: concurrency
|
|
|
|
@MainActor
|
|
protocol P {
|
|
func test() async
|
|
}
|
|
|
|
struct S : P {
|
|
func test() {}
|
|
}
|
|
|
|
// CHECK-LABEL: sil private [transparent] [thunk] [ossa] @$s10issue623941SVAA1PA2aDP4testyyYaFTW : $@convention(witness_method: P) @async (@in_guaranteed S) -> ()
|
|
// CHECK: [[MAIN_ACTOR:%.*]] = begin_borrow {{.*}} : $MainActor
|
|
// CHECK-NEXT: hop_to_executor [[MAIN_ACTOR]] : $MainActor
|
|
// CHECK: [[SELF:%.*]] = load [trivial] %0 : $*S
|
|
// CHECK: [[TEST_FN:%.*]] = function_ref @$s10issue623941SV4testyyF : $@convention(method) (S) -> ()
|
|
// CHECK-NEXT: {{.*}} = apply [[TEST_FN]]([[SELF]]) : $@convention(method) (S) -> ()
|