Skip to content

Commit 144b9fa

Browse files
committed
AST: Assert precondition in getSpecializedConformance()
1 parent 0696ec6 commit 144b9fa

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/AST/ASTContext.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2714,6 +2714,9 @@ ProtocolConformance *
27142714
ASTContext::getSpecializedConformance(Type type,
27152715
NormalProtocolConformance *generic,
27162716
SubstitutionMap substitutions) {
2717+
CONDITIONAL_ASSERT(substitutions.getGenericSignature().getCanonicalSignature()
2718+
== generic->getGenericSignature().getCanonicalSignature());
2719+
27172720
// If the specialization is a no-op, use the root conformance instead.
27182721
if (collapseSpecializedConformance(type, generic, substitutions)) {
27192722
++NumCollapsedSpecializedProtocolConformances;

0 commit comments

Comments
 (0)