Skip to content

Commit 88ec6cb

Browse files
committed
Update Two Tests Relying on Explicit NSObjectProtocol Conformances
These conformances are banned when using NSObjectProtocl in the real SDK. Adding the `self` member has exposed these few places and started diagnosing them as invalid again.
1 parent 9203d45 commit 88ec6cb

File tree

2 files changed

+1
-17
lines changed

2 files changed

+1
-17
lines changed

test/ClangImporter/objc_parse.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ func ivars(_ hive: Hive) {
315315
hive.queen.description() // expected-error{{value of type 'Hive' has no member 'queen'}}
316316
}
317317

318-
class NSObjectable : NSObjectProtocol {
318+
class NSObjectable : NSObjectProtocol { // expected-error {{cannot declare conformance to 'NSObjectProtocol' in Swift; 'NSObjectable' should inherit 'NSObject' instead}}
319319
@objc var description : String { return "" }
320320
@objc(conformsToProtocol:) func conforms(to _: Protocol) -> Bool { return false }
321321
@objc(isKindOfClass:) func isKind(of aClass: AnyClass) -> Bool { return false }

test/PrintAsObjC/classes.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -113,22 +113,6 @@ class ClassWithCustomName2 {}
113113
@objc(CustomNameSub)
114114
class ClassWithCustomNameSub : ClassWithCustomName {}
115115

116-
117-
// CHECK-LABEL: @interface ClassWithNSObjectProtocol <NSObject>
118-
// CHECK-NEXT: @property (nonatomic, readonly, copy) NSString * _Nonnull description;
119-
// CHECK-NEXT: - (BOOL)conformsToProtocol:(Protocol * _Nonnull)_ SWIFT_WARN_UNUSED_RESULT;
120-
// CHECK-NEXT: - (BOOL)isKindOfClass:(Class _Nonnull)aClass SWIFT_WARN_UNUSED_RESULT;
121-
// CHECK-NEXT: - (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;
122-
// CHECK-NEXT: @end
123-
@objc @objcMembers class ClassWithNSObjectProtocol : NSObjectProtocol {
124-
@objc var description: String { return "me" }
125-
@objc(conformsToProtocol:)
126-
func conforms(to _: Protocol) -> Bool { return false }
127-
128-
@objc(isKindOfClass:)
129-
func isKind(of aClass: AnyClass) -> Bool { return false }
130-
}
131-
132116
// CHECK-LABEL: @interface DiscardableResult : NSObject
133117
// CHECK-NEXT: - (NSInteger)nonDiscardable:(NSInteger)x SWIFT_WARN_UNUSED_RESULT;
134118
// CHECK-NEXT: - (NSInteger)discardable:(NSInteger)x;

0 commit comments

Comments
 (0)