@@ -2415,9 +2415,7 @@ TypeEraserHasViableInitRequest::evaluate(Evaluator &evaluator,
24152415 }
24162416
24172417 // The type eraser must conform to the annotated protocol
2418- SmallVector<ProtocolConformance *, 2 > conformances;
2419- if (!nominalTypeDecl->lookupConformance (dc->getParentModule (), protocol,
2420- conformances)) {
2418+ if (!TypeChecker::conformsToProtocol (typeEraser, protocol, dc, None)) {
24212419 diags.diagnose (typeEraserLoc.getLoc (), diag::type_eraser_does_not_conform,
24222420 typeEraser, protocolType);
24232421 diags.diagnose (nominalTypeDecl->getLoc (), diag::type_eraser_declared_here);
@@ -2464,13 +2462,15 @@ TypeEraserHasViableInitRequest::evaluate(Evaluator &evaluator,
24642462 typeEraser->getContextSubstitutionMap (nominalTypeDecl->getParentModule (),
24652463 nominalTypeDecl);
24662464 QuerySubstitutionMap getSubstitution{baseMap};
2467- auto subMap = genericSignature->getIdentitySubstitutionMap ().subst (
2465+ auto subMap = SubstitutionMap::get (
2466+ genericSignature,
24682467 [&](SubstitutableType *type) -> Type {
24692468 if (type->isEqual (genericParamType))
24702469 return protocol->getSelfTypeInContext ();
24712470
24722471 return getSubstitution (type);
2473- }, TypeChecker::LookUpConformance (dc));
2472+ },
2473+ TypeChecker::LookUpConformance (dc));
24742474
24752475 // Use invalid 'SourceLoc's to suppress diagnostics.
24762476 auto result = TypeChecker::checkGenericArguments (
0 commit comments