File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -624,7 +624,7 @@ struct LLVM_LIBRARY_VISIBILITY NonFixedExistentialMetatypeBox
624
624
ExistentialMetatypeContainer Header;
625
625
626
626
static unsigned getNumWitnessTables (const Metadata *self) {
627
- auto castSelf = static_cast <const ExistentialTypeMetadata *>(self);
627
+ auto castSelf = static_cast <const ExistentialMetatypeMetadata *>(self);
628
628
return castSelf->Flags .getNumWitnessTables ();
629
629
}
630
630
Original file line number Diff line number Diff line change @@ -666,6 +666,18 @@ Reflection.test("ObjectIdentifier/CustomDebugStringConvertible") {
666
666
667
667
}
668
668
669
+ class C: Q1 & Codable { }
670
+
671
+ Reflection.test("multiprotocolTypes") {
672
+ // [SR-8158]: Printing type(of: Codable & Protocol type ) EXC_BAD_ACCESS
673
+ // This use of String(reflecting:) exercises a previously incorrect cast in
674
+ // NonFixedExistentialMetatypeBox::Container::getNumWitnessTables.
675
+ let obj: Q1 & Codable = C()
676
+ let t = type(of: obj)
677
+ let x = String(reflecting: t)
678
+ expectEqual("a.C", x)
679
+ }
680
+
669
681
670
682
var BitTwiddlingTestSuite = TestSuite("BitTwiddling")
671
683
You can’t perform that action at this time.
0 commit comments