Serialization: Serialize ProtocolDecl::getSuperclassDecl() instead of ProtocolDecl::getSuperclass()

Protocols with a superclass bound written as `protocol P where Self: C`
return null from getSuperclass(). Unqualified lookup only cares about
getSuperclassDecl(), so serialize that instead.

Fixes rdar://problem/124478687.
This commit is contained in:
Slava Pestov
2024-03-20 15:36:06 -04:00
parent 582ec11cee
commit e3d434fbbe
5 changed files with 51 additions and 15 deletions

View File

@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
/// describe what change you made. The content of this comment isn't important;
/// it just ensures a conflict if two people change the module format.
/// Don't worry about adhering to the 80-column limit for this line.
const uint16_t SWIFTMODULE_VERSION_MINOR = 865; // removal of noncopyable generics control block
const uint16_t SWIFTMODULE_VERSION_MINOR = 866; // protocol superclass fix
/// A standard hash seed used for all string hashes in a serialized module.
///
@@ -1535,7 +1535,7 @@ namespace decls_block {
BCFixed<1>, // class-bounded?
BCFixed<1>, // objc?
BCFixed<1>, // existential-type-supported?
TypeIDField, // superclass
DeclIDField, // superclass decl
AccessLevelField, // access level
BCArray<TypeIDField> // dependency types
// Trailed by the inherited protocols, the generic parameters (if any),