[AST] Eliminate ModuleDecl parameters from GenericSignature.

This commit is contained in:
Doug Gregor
2017-10-09 17:31:05 -07:00
parent 936a701b15
commit 1f1b75a56d
24 changed files with 96 additions and 130 deletions

View File

@@ -133,8 +133,7 @@ Type SubstitutionMap::lookupSubstitution(CanSubstitutableType type) const {
// The generic parameter may have been made concrete by the generic signature,
// substitute into the concrete type.
ModuleDecl &anyModule = *genericParam->getASTContext().getStdlibModule();
if (auto concreteType = genericSig->getConcreteType(genericParam, anyModule)){
if (auto concreteType = genericSig->getConcreteType(genericParam)){
// Set the replacement type to an error, to block infinite recursion.
replacementType = ErrorType::get(concreteType);
@@ -191,14 +190,13 @@ SubstitutionMap::lookupConformance(CanType type, ProtocolDecl *proto) const {
};
auto genericSig = getGenericSignature();
auto &mod = *proto->getModuleContext();
// If the type doesn't conform to this protocol, fail.
if (!genericSig->conformsToProtocol(type, proto, mod))
if (!genericSig->conformsToProtocol(type, proto))
return None;
auto accessPath =
genericSig->getConformanceAccessPath(type, proto, mod);
genericSig->getConformanceAccessPath(type, proto);
// Fall through because we cannot yet evaluate an access path.
Optional<ProtocolConformanceRef> conformance;