mirror of
https://github.com/apple/swift.git
synced 2026-10-20 19:13:47 +02:00
objc_msgSend provides arguments unowned at +0 to the thunk ending in `To` invoked on the ObjC side of things. When marking a parameter in ObjC with Swift's `sending`, that should not change the parameter convention of the ObjC thunk, as `sending` is a Swift concept. I believe this issue was fixed by: https://github.com/swiftlang/swift/pull/87926 Thus, this is a test-only change to add coverage for https://github.com/swiftlang/swift/issues/87659 and other situations. rdar://143019970 Co-authored-by: Peter Rong <PeterRong@meta.com>
38 lines
794 B
Objective-C
38 lines
794 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
@class Bar;
|
|
@class Baz;
|
|
@protocol FooDelegate;
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@interface Foo: NSObject
|
|
@property (weak, nullable) id <FooDelegate> delegate;
|
|
- (NSString *)doSomething;
|
|
@end
|
|
|
|
@protocol FooDelegate <NSObject>
|
|
- (NSString *)takingObject:(NSObject *)NS_SWIFT_SENDING object;
|
|
|
|
- (NSObject * NS_SWIFT_SENDING)identityFn:(NSObject *)NS_SWIFT_SENDING object;
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
// ----------------------------------------------------
|
|
// From https://github.com/swiftlang/swift/issues/87659
|
|
|
|
@class Payload;
|
|
|
|
@interface Payload : NSObject
|
|
@property (nonatomic, copy) NSString *name;
|
|
@end
|
|
|
|
NS_SWIFT_SENDABLE
|
|
@protocol Handler <NSObject>
|
|
- (void)handle:(NS_SWIFT_SENDING Payload *)value;
|
|
@end
|
|
|
|
@interface LegacyObjCHandler : NSObject <Handler>
|
|
@end
|