mirror of
https://github.com/apple/swift.git
synced 2026-10-18 17:49:23 +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>
30 lines
566 B
Objective-C
30 lines
566 B
Objective-C
|
|
#import "objc_sending_execution.h"
|
|
|
|
@implementation Foo {
|
|
__weak id <FooDelegate> _delegate;
|
|
}
|
|
|
|
@synthesize delegate=_delegate;
|
|
|
|
- (NSString *)doSomething {
|
|
NSObject *obj = [[NSObject alloc] init];
|
|
obj = [_delegate identityFn: obj];
|
|
return [_delegate takingObject: obj];
|
|
}
|
|
|
|
@end
|
|
|
|
|
|
// ----------------------------------------------------
|
|
// From https://github.com/swiftlang/swift/issues/87659
|
|
|
|
@implementation Payload
|
|
@end
|
|
|
|
@implementation LegacyObjCHandler
|
|
- (void)handle:(Payload *)value {
|
|
NSLog(@"LegacyObjCHandler received: %@", value.name);
|
|
}
|
|
@end
|