mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
20 lines
769 B
Swift
20 lines
769 B
Swift
// RUN: %target-swift-emit-silgen %s | %FileCheck %s
|
|
// REQUIRES: concurrency
|
|
|
|
|
|
// CHECK: sil [ossa] @$s29mangling_predates_concurrency16excitingFunction5value4bodyyycx_yycSgtlF : $@convention(thin) <T where T : Sendable> (@in_guaranteed T, @guaranteed Optional<@Sendable @callee_guaranteed () -> ()>) -> @owned @callee_guaranteed () -> ()
|
|
@preconcurrency
|
|
public func excitingFunction<T: Sendable>(value: T, body: (@Sendable () -> Void)?) -> (@MainActor () -> Void) {
|
|
{ }
|
|
}
|
|
|
|
public protocol P { }
|
|
|
|
// CHECK: sil [ossa] @$s29mangling_predates_concurrency13lotsOfChangesyyXlSgyp_AA1P_pypXpAaD_XlXptF
|
|
@preconcurrency public func lotsOfChanges(
|
|
_: Sendable, _: P & Sendable, _: Sendable.Type,
|
|
_: (AnyObject & Sendable & P).Type
|
|
) -> (AnyObject & Sendable)? {
|
|
nil
|
|
}
|