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:
Doug Gregor
2021-07-27 23:07:55 -07:00
parent 20cc067844
commit ecd830e342
9 changed files with 59 additions and 76 deletions

View File

@@ -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.