Skip to content

Commit 32a0ea8

Browse files
committed
ConformanceLookup: catch ReferenceStorageType
While this doesn't provde defence agianst incorrect conformance responses in the general case, it should flush out a lot of incorrect ones.
1 parent 08c30a2 commit 32a0ea8

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/AST/ConformanceLookup.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -565,13 +565,16 @@ LookupConformanceInModuleRequest::evaluate(
565565
#ifndef NDEBUG
566566
// Ensure we haven't missed queries for the specialty SIL types
567567
// in the AST in conformance to one of the invertible protocols.
568-
if (auto kp = protocol->getKnownProtocolKind())
569-
if (getInvertibleProtocolKind(*kp))
568+
if (auto kp = protocol->getKnownProtocolKind()) {
569+
if (getInvertibleProtocolKind(*kp)) {
570570
assert(!(type->is<SILFunctionType,
571571
SILBoxType,
572572
SILMoveOnlyWrappedType,
573573
SILPackType,
574574
SILTokenType>()));
575+
assert(!type->is<ReferenceStorageType>());
576+
}
577+
}
575578
#endif
576579

577580
auto nominal = type->getAnyNominal();

0 commit comments

Comments
 (0)