Skip to content

Commit 2a5135b

Browse files
[PrintAsObjC] Test that SWIFT_METHOD_FAMILY is not printed for non-initializer methods with inferable method families
1 parent af3983e commit 2a5135b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/PrintAsObjC/classes.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ class NotObjC {}
226226
// CHECK-NEXT: - (void)initAllTheThings SWIFT_METHOD_FAMILY(none);
227227
// CHECK-NEXT: - (void)initTheOtherThings SWIFT_METHOD_FAMILY(none);
228228
// CHECK-NEXT: - (void)initializeEvenMoreThings;
229+
// CHECK-NEXT: + (Methods * _Nonnull)newWithFoo:(NSInteger)foo SWIFT_WARN_UNUSED_RESULT;
229230
// CHECK-NEXT: init
230231
// CHECK-NEXT: @end
231232
@objc class Methods {
@@ -286,6 +287,8 @@ class NotObjC {}
286287
@objc func initAllTheThings() {}
287288
@objc(initTheOtherThings) func setUpOtherThings() {}
288289
@objc func initializeEvenMoreThings() {}
290+
291+
@objc(newWithFoo:) class func make(foo: Int) -> Methods { return Methods() }
289292
}
290293

291294
typealias AliasForNSRect = NSRect

0 commit comments

Comments
 (0)