mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Test that macros can be applied to imported Objective-C declarations
These currently end up as "open", which is incorrect (we need to make them "final"). This cannot be addressed until we pass the lexical context down to the macro, which is currently... a bit tricky.
This commit is contained in:
@@ -7,3 +7,14 @@ typedef struct SlowComputer {
|
||||
void computer_divide(const SlowComputer *computer, double x, double y, void (* _Nonnull completionHandler)(double x))
|
||||
__attribute__((swift_attr("@macro_library.AddAsync")))
|
||||
__attribute__((swift_name("SlowComputer.divide(self:_:_:completionHandler:)")));
|
||||
|
||||
|
||||
#if __OBJC__
|
||||
@import Foundation;
|
||||
|
||||
@interface Computer: NSObject
|
||||
-(void)multiply:(double)x by:(double)y afterDone:(void (^ _Nonnull)(double x))afterDone
|
||||
__attribute__((swift_attr("@macro_library.AddAsync")))
|
||||
__attribute__((swift_async(none)));
|
||||
@end
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user