mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
This can lead to latent type errors for API users, because a swiftmodule would otherwise be emitted, without any diagnostics, containing imported decl with two global actor annotations on it. Such decls will always be an error to the typechecker when its eventually encountered. This patch drops all `@MainActor` annotations after the first one in the ClangImporter, regardless of whether its the safe or unsafe version, and emits a warning when doing so.
18 lines
502 B
Objective-C
18 lines
502 B
Objective-C
@import Foundation;
|
|
|
|
#pragma clang assume_nonnull begin
|
|
|
|
#define SWIFT_MAIN_ACTOR __attribute__((swift_attr("@MainActor")))
|
|
#define SWIFT_UI_ACTOR __attribute__((swift_attr("@UIActor")))
|
|
|
|
// NOTE: If you ever end up removing support for the "@UIActor" alias,
|
|
// just change both to be @MainActor and it won't change the purpose of
|
|
// this test.
|
|
|
|
SWIFT_UI_ACTOR SWIFT_MAIN_ACTOR @protocol DoubleMainActor
|
|
@required
|
|
- (NSString *)createSeaShanty:(NSInteger)number;
|
|
@end
|
|
|
|
#pragma clang assume_nonnull end
|