Skip to content

Commit 9c30d07

Browse files
committed
Sema: Assert precondition in TypeChecker::performTypoCorrection()
1 parent e894d4a commit 9c30d07

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

lib/Sema/TypeCheckNameLookup.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,10 @@ void TypeChecker::performTypoCorrection(DeclContext *DC, DeclRefKind refKind,
581581
TypoCorrectionResults &corrections,
582582
GenericSignature genericSig,
583583
unsigned maxResults) {
584+
// Even when typo correction is disabled, we want to make sure people are
585+
// calling into it the right way.
586+
assert(!baseTypeOrNull || !baseTypeOrNull->hasTypeParameter() || genericSig);
587+
584588
// Disable typo-correction if we won't show the diagnostic anyway or if
585589
// we've hit our typo correction limit.
586590
auto &Ctx = DC->getASTContext();

0 commit comments

Comments
 (0)