Parameterize the resolution of generic type parameter types to archetypes.

When type checking, allow the caller to customize the resolution of generic
type parameter types based on the context, for example, by choosing to
substitute in an archetype (or not) and allowing one to resolve a dependent
member reference via a specific archetype.

No actual functionality change here.


Swift SVN r8797
This commit is contained in:
Doug Gregor
2013-09-30 23:24:53 +00:00
parent c003b4e23d
commit f5d4269f53
12 changed files with 376 additions and 98 deletions

View File

@@ -1898,12 +1898,14 @@ Type ModuleFile::getType(TypeID TID) {
case decls_block::DEPENDENT_MEMBER_TYPE: {
TypeID baseID;
IdentifierID nameID;
DeclID assocTypeID;
decls_block::DependentMemberTypeLayout::readRecord(scratch, baseID, nameID);
typeOrOffset = DependentMemberType::get(getType(baseID),
getIdentifier(nameID),
ctx);
decls_block::DependentMemberTypeLayout::readRecord(scratch, baseID,
assocTypeID);
typeOrOffset = DependentMemberType::get(
getType(baseID),
cast<AssociatedTypeDecl>(getDecl(assocTypeID)),
ctx);
break;
}