- Notifications
You must be signed in to change notification settings - Fork 10.5k
/
Copy pathemit_objc_header_with_Sendable.swift
29 lines (24 loc) · 1.01 KB
/
emit_objc_header_with_Sendable.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -typecheck %s -parse-as-library -emit-objc-header-path %t/swift.h
// RUN: %FileCheck %s < %t/swift.h
// REQUIRES: concurrency
// REQUIRES: asserts
// REQUIRES: objc_interop
import Foundation
@objcpublicprotocolP{}
@objcpublicclassKlass:NSObject{
// CHECK: - (void)test1:(NSDictionary<NSString *, id> * _Nonnull)_;
@objcpublicfunc test1(_:[String:anySendable]){}
// CHECK: - (void)test2:(NSDictionary<NSString *, id <P>> * _Nonnull)_;
@objcpublicfunc test2(_:[String:anyP&Sendable]){}
}
@objcpublicprotocolQ{
// CHECK: - (NSArray<NSDictionary<NSString *, id> *> * _Nonnull)data1 SWIFT_WARN_UNUSED_RESULT;
func data1()->[[String:anySendable]]
// CHECK: - (NSArray * _Nullable)data2 SWIFT_WARN_UNUSED_RESULT;
func data2()->[anySendable]?
// CHECK: - (void)data3:(id _Nonnull)_;
func data3(_:anySendable)
// CHECK: - (void)data4:(id _Nullable)_;
func data4(_:(anySendable)?)
}