Skip to content

Commit 44b73b9

Browse files
committed
SILGen: Remove a usage of ProtocolConformanceRef::getAssociatedType()
1 parent f455898 commit 44b73b9

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/SILGen/SILGenType.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,11 @@ class SILGenConformance : public SILGenWitnessTable<SILGenConformance> {
692692
auto assocConformance =
693693
Conformance->getAssociatedConformance(req.getAssociation(),
694694
req.getAssociatedRequirement());
695-
auto substType =
696-
Conformance->getAssociatedType(req.getAssociation())->getCanonicalType();
697-
698695
SGM.useConformance(assocConformance);
699696

697+
auto substType = (assocConformance
698+
? assocConformance.getType()
699+
: ErrorType::get(SGM.getASTContext()))->getCanonicalType();
700700
Entries.push_back(SILWitnessTable::AssociatedConformanceWitness{
701701
req.getAssociation(), substType, assocConformance});
702702
}

0 commit comments

Comments
 (0)