Skip to content

Commit ba6ff41

Browse files
committed
AST: Remove getAssociatedType() call from PackConformance
1 parent a06a421 commit ba6ff41

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/AST/PackConformance.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,20 +142,20 @@ PackConformance *PackConformance::getAssociatedConformance(
142142
auto packElement = ConformingType->getElementType(i);
143143

144144
if (auto *packExpansion = packElement->getAs<PackExpansionType>()) {
145-
auto assocTypePattern = conformances[i].getAssociatedType(assocType);
146-
packElements.push_back(PackExpansionType::get(
147-
assocTypePattern, packExpansion->getCountType()));
148-
149145
auto assocConformancePattern =
150146
conformances[i].getAssociatedConformance(assocType, protocol);
151147
packConformances.push_back(assocConformancePattern);
152-
} else {
153-
auto assocTypeScalar = conformances[i].getAssociatedType(assocType);
154-
packElements.push_back(assocTypeScalar);
155148

149+
auto assocTypePattern = assocConformancePattern.getType();
150+
packElements.push_back(PackExpansionType::get(
151+
assocTypePattern, packExpansion->getCountType()));
152+
} else {
156153
auto assocConformanceScalar =
157154
conformances[i].getAssociatedConformance(assocType, protocol);
158155
packConformances.push_back(assocConformanceScalar);
156+
157+
auto assocTypeScalar = assocConformanceScalar.getType();
158+
packElements.push_back(assocTypeScalar);
159159
}
160160
}
161161

0 commit comments

Comments
 (0)