mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The @objc method argument bridging did the right thing but for func to block thunks we didn't handle optionals and IUOs. Symptoms included memory leaks because IRGen would later try to retain the block by calling Block_copy() and discarding the result, or memory corruption because the on-stack block could outlive its stack frame. Fixes <rdar://problem/22471309>. Swift SVN r31882
22 lines
411 B
Objective-C
22 lines
411 B
Objective-C
#import "ObjectiveC.h"
|
|
|
|
typedef void (^AnseCompletion)();
|
|
typedef void (^AnseCallback)(AnseCompletion completionBlock);
|
|
|
|
@interface Ansible : NSObject
|
|
- (Ansible*)initWithBellsOn:(id)theBells;
|
|
+ (void)anseAsync:(AnseCallback)block;
|
|
@end
|
|
|
|
static Ansible *NSAnse(Ansible *x) {
|
|
return x;
|
|
}
|
|
|
|
Ansible *NSAnseExternal(Ansible *x) {
|
|
return x;
|
|
}
|
|
|
|
void hasNoPrototype();
|
|
|
|
static void staticForwardDeclaration(void);
|