Skip to content

Commit afbf844

Browse files
committed
Sema: Implement support for projecting member types from PackType in simplifyType()
1 parent 87c0b2d commit afbf844

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/Sema/ConstraintSystem.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,7 +3618,8 @@ Type ConstraintSystem::simplifyTypeImpl(Type type,
36183618
if (auto selfType = lookupBaseType->getAs<DynamicSelfType>())
36193619
lookupBaseType = selfType->getSelfType();
36203620

3621-
if (lookupBaseType->mayHaveMembers()) {
3621+
if (lookupBaseType->mayHaveMembers() ||
3622+
lookupBaseType->is<PackType>()) {
36223623
auto *proto = assocType->getProtocol();
36233624
auto conformance = DC->getParentModule()->lookupConformance(
36243625
lookupBaseType, proto);
@@ -3642,9 +3643,8 @@ Type ConstraintSystem::simplifyTypeImpl(Type type,
36423643
return memberTy;
36433644
}
36443645

3645-
auto subs = SubstitutionMap::getProtocolSubstitutions(
3646-
proto, lookupBaseType, conformance);
3647-
auto result = assocType->getDeclaredInterfaceType().subst(subs);
3646+
auto result = conformance.getAssociatedType(
3647+
lookupBaseType, assocType->getDeclaredInterfaceType());
36483648
if (!result->hasError())
36493649
return result;
36503650
}

0 commit comments

Comments
 (0)