Skip to content

Commit acb0e9a

Browse files
committed
Sema: Pass down tentative type witnesses in inferAbstractTypeWitnesses()
1 parent 9dadbc0 commit acb0e9a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/Sema/TypeCheckProtocolInference.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,8 +1497,10 @@ AssociatedTypeDecl *AssociatedTypeInference::inferAbstractTypeWitnesses(
14971497
// If the transformed base has the same nominal as the adoptee, we may
14981498
// need to look up a tentative type witness. Otherwise, just substitute
14991499
// the base.
1500-
if (substBase->getAnyNominal() != adoptee->getAnyNominal()) {
1501-
return dmt->substBaseType(dc->getParentModule(), substBase);
1500+
if (substBase->getAnyNominal() != dc->getSelfNominalTypeDecl()) {
1501+
return dmt->substBaseType(substBase,
1502+
LookUpConformanceInModule(dc->getParentModule()),
1503+
substOptions);
15021504
}
15031505

15041506
auto *assocTy = dmt->getAssocType();

0 commit comments

Comments
 (0)