mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
A `@convention(block)` closure in Swift is completely compatible with Objective-C and does not need to be wrapped in a `__SwiftValue` box for use. Previously, it was bridged verbatim when appearing by itself, but could end up boxed when it went through array bridging. The test verifies that: * Objective-C does not see a `__SwiftValue` box * Swift `type(of:)` does not see a `__SwiftValue` box * Objective-C can actually call the closure Resolves rdar://138132321
10 lines
192 B
Objective-C
10 lines
192 B
Objective-C
#ifndef SWIFT_TEST_CAST_BLOCKS_H
|
|
#define SWIFT_TEST_CAST_BLOCKS_H
|
|
|
|
#import <Foundation/Foundation.h>
|
|
|
|
BOOL ObjCThinksObjectIsSwiftValue(id obj);
|
|
void ObjCCanCallBlock(id block_as_id);
|
|
|
|
#endif
|