File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -7402,12 +7402,20 @@ static void finishSignatureConformances(
7402
7402
if (req.getKind () != RequirementKind::Conformance)
7403
7403
continue ;
7404
7404
7405
- assert (req.getFirstType ()->isEqual (proto->getSelfInterfaceType ()));
7405
+ Type substTy;
7406
+ auto origTy = req.getFirstType ();
7407
+ if (origTy->isEqual (proto->getSelfInterfaceType ())) {
7408
+ substTy = conformance->getType ();
7409
+ } else {
7410
+ auto *depMemTy = origTy->castTo <DependentMemberType>();
7411
+ assert (depMemTy->getBase ()->isEqual (proto->getSelfInterfaceType ()));
7412
+ substTy = conformance->getTypeWitness (depMemTy->getAssocType (),
7413
+ /* resolver=*/ nullptr );
7414
+ }
7406
7415
auto reqProto = req.getSecondType ()->castTo <ProtocolType>()->getDecl ();
7407
7416
7408
7417
ModuleDecl *M = conformance->getDeclContext ()->getParentModule ();
7409
- auto reqConformance = M->lookupConformance (conformance->getType (),
7410
- reqProto);
7418
+ auto reqConformance = M->lookupConformance (substTy, reqProto);
7411
7419
assert (reqConformance && reqConformance->isConcrete () &&
7412
7420
" required conformance not found" );
7413
7421
reqConformances.push_back (*reqConformance);
You can’t perform that action at this time.
0 commit comments