@@ -2415,9 +2415,7 @@ TypeEraserHasViableInitRequest::evaluate(Evaluator &evaluator,
2415
2415
}
2416
2416
2417
2417
// 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)) {
2421
2419
diags.diagnose (typeEraserLoc.getLoc (), diag::type_eraser_does_not_conform,
2422
2420
typeEraser, protocolType);
2423
2421
diags.diagnose (nominalTypeDecl->getLoc (), diag::type_eraser_declared_here);
@@ -2464,13 +2462,15 @@ TypeEraserHasViableInitRequest::evaluate(Evaluator &evaluator,
2464
2462
typeEraser->getContextSubstitutionMap (nominalTypeDecl->getParentModule (),
2465
2463
nominalTypeDecl);
2466
2464
QuerySubstitutionMap getSubstitution{baseMap};
2467
- auto subMap = genericSignature->getIdentitySubstitutionMap ().subst (
2465
+ auto subMap = SubstitutionMap::get (
2466
+ genericSignature,
2468
2467
[&](SubstitutableType *type) -> Type {
2469
2468
if (type->isEqual (genericParamType))
2470
2469
return protocol->getSelfTypeInContext ();
2471
2470
2472
2471
return getSubstitution (type);
2473
- }, TypeChecker::LookUpConformance (dc));
2472
+ },
2473
+ TypeChecker::LookUpConformance (dc));
2474
2474
2475
2475
// Use invalid 'SourceLoc's to suppress diagnostics.
2476
2476
auto result = TypeChecker::checkGenericArguments (
0 commit comments