IRGen: Use interface types to implement the PolymorphicConvention.

Refactor the base PolymorphicConvention implementation to work using generic signatures and dependent types instead of GenericParamLists and archetypes, using an ArchetypeBuilder to produce representative archetypes as a convenience when we need to consider all of the requirements attached to a dependent type. In EmitPolymorphicParameters, map the dependent types into context to resolve the archetypes that should be bound in the body of the function.

Swift SVN r13685
This commit is contained in:
Joe Groff
2014-02-08 21:04:15 +00:00
parent 4ddcd152e3
commit 05daca8e79
7 changed files with 236 additions and 83 deletions

View File

@@ -427,9 +427,10 @@ ArrayRef<Substitution> BoundGenericType::getSubstitutions(
assert(type && "Unable to perform type substitution");
SmallVector<ProtocolConformance *, 4> conformances;
if (type->is<TypeVariableType>()) {
// If the type is a type variable, just fill in null conformances.
// FIXME: It seems like we should record these as requirements (?).
if (type->is<TypeVariableType>() || type->isDependentType()) {
// If the type is a type variable or is dependent, just fill in null
// conformances. FIXME: It seems like we should record these as
// requirements (?).
conformances.assign(archetype->getConformsTo().size(), nullptr);
} else {
// Find the conformances.