Skip to content

Commit e321955

Browse files
committed
more test coverage for ObjC async conformance
This adds regression test coverage for a situation related to rdar://73326085, but was just recently fixed in: swiftlang#35719
1 parent ffeb1d5 commit e321955

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

test/ClangImporter/objc_async_conformance.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,12 @@ class Rock : NSObject, Rollable {
7272
func roll() { roll(completionHandler: {}) }
7373
}
7474

75+
// additional coverage for a situation where only an argument label differs, excluding the completion handler.
76+
final class Moon : LabellyProtocol {
77+
func myMethod(_ value: Int, foo: Int) {}
78+
func myMethod(_ value: Int, newFoo foo: Int, completion: @escaping (Error?) -> Void) {}
79+
}
80+
7581
// Crash involving actor isolation checking.
7682
class C5 {
7783
@MainActor @objc var allOperations: [String] = []

test/Inputs/clang-importer-sdk/usr/include/ObjCConcurrency.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ typedef void ( ^ObjCErrorHandler )( NSError * _Nullable inError );
103103
- (void) activateWithCompletion:(ObjCErrorHandler) inCompletion;
104104
@end
105105

106+
@protocol LabellyProtocol
107+
- (void) myMethod:(NSInteger)value1 newFoo:(NSInteger)value2 completion:(ObjCErrorHandler)completion;
108+
- (void) myMethod:(NSInteger)value1 foo:(NSInteger)value2;
109+
@end
110+
106111
#define MAGIC_NUMBER 42
107112

108113
#pragma clang assume_nonnull end

0 commit comments

Comments
 (0)