mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Clang importer] Don't bridge blocks to Swift functions in ObjC generic args.
While the compiler can bridge C block types to Swift function types, the Swift runtime cannot. Don't bridge block types to Swift function types in Objective-C generic arguments, so NSArray<some-block-type> will get imported as [@convention(block) (...) -> Whatever] rather than [(...) -> Whatever] Fixes rdar://problem/40879067 in a fairly narrow way; the Clang importer's approach to adjusting types based on context needs a cleanup, but this is the safe, localized fix suitable for 4.2.
This commit is contained in:
@@ -113,3 +113,10 @@ typedef id <Fungible> FungibleObject;
|
||||
|
||||
@interface Third : Second<Third *>
|
||||
@end
|
||||
|
||||
typedef void (^ _Nonnull BlockPointerType)(void);
|
||||
|
||||
@interface HasBlockArray : NSObject
|
||||
- (NSArray<BlockPointerType> * _Nonnull)blockArray;
|
||||
- (BlockPointerType)blockPointerType;
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user