mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rework BuiltinProtocolConformance to be more like NormalProtocolConformance.
Give BuiltinProtocolConformance a generic signature, which can be used to describe the generic parameters used within the builtin conformance, e.g., `<T1, T2, T3>` for a tuple type `(T1, T2, T3)`. Also store the conditional requirements as trailing objects, requiring them to be precomputed by whatever builds the conformances. Together, this means that builtin protocol conformances act like normal conformances with respect to conditional requirements and substitutions: they will be defined generically, then a specialized conformance will be layered on top to provide the substitutions.
This commit is contained in:
@@ -1675,8 +1675,8 @@ namespace decls_block {
|
||||
BUILTIN_PROTOCOL_CONFORMANCE,
|
||||
TypeIDField, // the conforming type
|
||||
DeclIDField, // the protocol
|
||||
BCVBR<5> // the number of element conformances
|
||||
// the (optional) element conformances follow
|
||||
GenericSignatureIDField // the generic signature
|
||||
// the (optional) conditional requirements follow
|
||||
>;
|
||||
|
||||
// Refers to a normal protocol conformance in the given module via its id.
|
||||
|
||||
Reference in New Issue
Block a user