Files
swift-mirror/test/Concurrency/issue62394.swift
Pavel Yaskevich f6e02186ff [Concurrency] Synchronous witness of an async isolated requirement should hop
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
2024-02-08 13:00:22 -08:00

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) -> ()