Plumb a lot of querying for different kinds of existential

type.

Swift SVN r16232
This commit is contained in:
John McCall
2014-04-11 22:30:14 +00:00
parent ff5c3f0825
commit 8a85750c4c
18 changed files with 198 additions and 93 deletions

View File

@@ -706,7 +706,7 @@ LookupConformanceResult Module::lookupConformance(Type type,
return { nullptr, ConformanceKind::DoesNotConform };
}
// An archetype conforms to a protocol if the protocol is listed in the
// An existential conforms to a protocol if the protocol is listed in the
// existential's list of conformances and the existential conforms to
// itself.
if (type->isExistentialType()) {
@@ -724,7 +724,7 @@ LookupConformanceResult Module::lookupConformance(Type type,
// Look for this protocol within the existential's list of conformances.
SmallVector<ProtocolDecl *, 4> protocols;
type->isExistentialType(protocols);
type->getAnyExistentialTypeProtocols(protocols);
for (auto ap : protocols) {
if (ap == protocol || ap->inheritsFrom(protocol)) {
return { nullptr,