File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Inputs/clang-importer-sdk/usr/include Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -135,3 +135,14 @@ class ImplementsDictionaryLoader3: DictionaryLoader {
135
135
class ImplementsDictionaryLoader4 : DictionaryLoader {
136
136
func loadDictionary( completionHandler: @escaping ( [ String : Int ] ? ) -> Void ) { } // expected-note {{candidate has non-matching type '(@escaping ([String : Int]?) -> Void) -> ()'}}
137
137
}
138
+
139
+ class ImplementsFloatLoader : FloatLoader {
140
+ public func loadFloat( completionHandler: @escaping ( Float ) -> Void ) { }
141
+ }
142
+
143
+ class ImplementsFloatLoader2 : FloatLoader {
144
+ public func loadFloat( withCompletionHandler completionHandler: @escaping ( Float ) -> Void ) { }
145
+ // expected-warning@-1 {{instance method 'loadFloat(withCompletionHandler:)' nearly matches optional requirement 'loadFloat(completionHandler:)' of protocol 'FloatLoader'}}
146
+ // expected-note@-2 {{rename to 'loadFloat(completionHandler:)' to satisfy this requirement}}
147
+ // expected-note@-3 {{move 'loadFloat(withCompletionHandler:)' to an extension to silence this warning}}
148
+ }
Original file line number Diff line number Diff line change @@ -359,4 +359,9 @@ MAIN_ACTOR
359
359
- (void )loadDictionaryWithCompletionHandler : (void (^)(NSDictionary <NSString *, NSNumber *> * _Nullable))completionHandler ;
360
360
@end
361
361
362
+ @protocol FloatLoader
363
+ @optional
364
+ - (void )loadFloatWithCompletionHandler : (void (^)(float ))completionHandler ;
365
+ @end
366
+
362
367
#pragma clang assume_nonnull end
You can’t perform that action at this time.
0 commit comments