Skip to content

Commit 8a2ac36

Browse files
committed
In typo-correction, pass down the TypeChecker as the LazyResolver.
This should restore the invariant that various places in the AST are looking for, which is that declarations are considered invalid if they don't have certain things set.
1 parent 9420014 commit 8a2ac36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/Sema/TypeCheckNameLookup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ void TypeChecker::performTypoCorrection(DeclContext *DC, DeclRefKind refKind,
504504
entries.insert(distance, std::move(decl));
505505
});
506506

507-
lookupVisibleDecls(consumer, DC, nullptr, /*top level*/ true, nameLoc);
507+
lookupVisibleDecls(consumer, DC, this, /*top level*/ true, nameLoc);
508508

509509
// Impose a maximum distance from the best score.
510510
entries.filterMaxScoreRange(MaxCallEditDistanceFromBestCandidate);

0 commit comments

Comments
 (0)