Track the generic parameters and requirements of nominal type declarations.

Put generic nominal type declarations through the same dependent-type
validation as generic functions, then capture their generic parameters
and requirements in their generic signature. This allows us to
re-instate the requirements in their dependent forms, before the
archetypes ruin them completely.


Swift SVN r8958
This commit is contained in:
Doug Gregor
2013-10-07 16:21:25 +00:00
parent 6424e99da2
commit abeaef8996
11 changed files with 386 additions and 58 deletions

View File

@@ -320,6 +320,7 @@ namespace decls_block {
GENERIC_PARAM_LIST = 240,
GENERIC_PARAM,
GENERIC_REQUIREMENT,
LAST_GENERIC_REQUIREMENT,
NO_CONFORMANCE = 250,
NORMAL_PROTOCOL_CONFORMANCE = 251,
@@ -762,6 +763,17 @@ namespace decls_block {
BCArray<TypeIDField> // types involved (currently always two)
>;
/// Placeholder that marks the last generic requirement in the generic
/// parameters list.
///
/// Used as a buffer between the generic parameter list's requirements and
/// the generic signature's requirements for nominal type declarations.
/// FIXME: Expected to go away once the latter is no longer serialized.
using LastGenericRequirementLayout = BCRecordLayout<
LAST_GENERIC_REQUIREMENT,
BCFixed<1> // dummy
>;
/// A placeholder for lack of conformance information. Conformances are
/// indexed, so simply omitting one would be incorrect.
using NoConformanceLayout = BCRecordLayout<