Files
swift-mirror/test/SILGen/Inputs/usr/include/Ansible.h
Slava Pestov d313fa7d42 SILGen: @convention(block) bridging thunks need to copy blocks in optionals
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
2015-09-11 03:08:03 +00:00

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);