Skip to content

Commit 7732306

Browse files
committed
Add regression test to close #43135
1 parent 7158760 commit 7732306

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

test/stdlib/Inputs/Mirror/Mirror.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,7 @@
2727
@interface FooMoreDerivedObjCClass : FooDerivedObjCClass
2828
@end
2929

30+
@interface StringConvertibleInDebugAndOtherwise_ObjC : NSObject
31+
@end
32+
3033
#endif

test/stdlib/Inputs/Mirror/Mirror.mm

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,14 @@ @implementation FooDerivedObjCClass : FooObjCClass
3131
@implementation FooMoreDerivedObjCClass : FooDerivedObjCClass
3232
@end
3333

34+
@implementation StringConvertibleInDebugAndOtherwise_ObjC : NSObject
35+
36+
-(NSString *) description {
37+
return @"description";
38+
}
39+
40+
-(NSString *) debugDescription {
41+
return @"debugDescription";
42+
}
43+
44+
@end

test/stdlib/RuntimeObjC.swift

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,14 +740,17 @@ Reflection.test("Name of metatype of artificial subclass") {
740740
expectEqual(String(reflecting: type(of: obj)), "a.TestArtificialSubclass")
741741
}
742742

743-
@objc class StringConvertibleInDebugAndOtherwise : NSObject {
743+
@objc class StringConvertibleInDebugAndOtherwise_Native : NSObject {
744744
override var description: String { return "description" }
745745
override var debugDescription: String { return "debugDescription" }
746746
}
747747

748748
Reflection.test("NSObject is properly CustomDebugStringConvertible") {
749-
let object = StringConvertibleInDebugAndOtherwise()
750-
expectEqual(String(reflecting: object), object.debugDescription)
749+
let objectNative = StringConvertibleInDebugAndOtherwise_Native()
750+
let objectObjC = StringConvertibleInDebugAndOtherwise_ObjC()
751+
752+
expectEqual(String(reflecting: objectNative), objectNative.debugDescription)
753+
expectEqual(String(reflecting: objectObjC), objectObjC.debugDescription)
751754
}
752755

753756
Reflection.test("NSRange QuickLook") {

0 commit comments

Comments
 (0)