mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Serialization] Recover from ObjC protocols changing inheritance. (#11109)
When there's an Objective-C protocol that adopts other protocols, the other protocols become part of the requirement signature. If that can change, Swift conformances to that protocol will get very confused when it comes time to deserialize the conformances that satisfy the requirement signature. To recover from this, just deserialize /all/ trailing conformances, rather than follow the requirement signature, and match them up after the fact. (This only works for Objective-C protocols where we know all conformance requirements represent inherited protocols, as opposed to constraints on associated types.) rdar://problem/33356098
This commit is contained in:
@@ -1361,6 +1361,9 @@ void Serializer::writeNormalConformance(
|
||||
return false;
|
||||
});
|
||||
|
||||
unsigned numSignatureConformances =
|
||||
conformance->getSignatureConformances().size();
|
||||
|
||||
unsigned abbrCode
|
||||
= DeclTypeAbbrCodes[NormalProtocolConformanceLayout::Code];
|
||||
auto ownerID = addDeclContextRef(conformance->getDeclContext());
|
||||
@@ -1368,6 +1371,7 @@ void Serializer::writeNormalConformance(
|
||||
addDeclRef(protocol), ownerID,
|
||||
numValueWitnesses,
|
||||
numTypeWitnesses,
|
||||
numSignatureConformances,
|
||||
data);
|
||||
|
||||
// Write requirement signature conformances.
|
||||
|
||||
Reference in New Issue
Block a user