File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -304,9 +304,18 @@ Runtime.test("isBridgedVerbatimToObjectiveC") {
304
304
305
305
//===----------------------------------------------------------------------===//
306
306
307
+ protocol SomeNativeProto { }
308
+
307
309
class SomeClass { }
308
310
@objc class SomeObjCClass { }
309
- class SomeNSObjectSubclass : NSObject { }
311
+
312
+ class SomeNSObjectSubclass : NSObject , SomeNativeProto { }
313
+ extension SomeNativeProto {
314
+ // https://github.com/apple/swift/issues/43154
315
+ func expectSelfTypeNameEqual( to typeName: String ) {
316
+ expectEqual ( typeName, _typeName ( type ( of: self ) ) )
317
+ }
318
+ }
310
319
311
320
Runtime . test ( " typeName " ) {
312
321
expectEqual ( " a.SomeObjCClass " , _typeName ( SomeObjCClass . self) )
@@ -321,6 +330,8 @@ Runtime.test("typeName") {
321
330
322
331
a = NSObject ( )
323
332
expectEqual ( " NSObject " , _typeName ( type ( of: a) ) )
333
+
334
+ SomeNSObjectSubclass ( ) . expectSelfTypeNameEqual ( to: " a.SomeNSObjectSubclass " )
324
335
}
325
336
326
337
class GenericClass < T> { }
@@ -571,7 +582,7 @@ Reflection.test("Class/ObjectiveCBase/Default") {
571
582
expectEqual ( expected, output)
572
583
}
573
584
}
574
- protocol SomeNativeProto { }
585
+
575
586
@objc protocol SomeObjCProto { }
576
587
extension SomeClass : SomeObjCProto { }
577
588
You can’t perform that action at this time.
0 commit comments