@@ -100,8 +100,7 @@ namespace {
100100 ModuleDecl &M;
101101 const ASTContext &Ctx;
102102 const SourceLoc Loc;
103- const SourceManager &SM;
104-
103+
105104 // / Used to find the file-local names.
106105 DebuggerClient *const DebugClient;
107106
@@ -152,8 +151,6 @@ namespace {
152151
153152#pragma mark context-based lookup declarations
154153
155- bool isInsideBodyOfFunction (const AbstractFunctionDecl *const AFD) const ;
156-
157154 // / For diagnostic purposes, move aside the unavailables, and put
158155 // / them back as a last-ditch effort.
159156 // / Could be cleaner someday with a richer interface to UnqualifiedLookup.
@@ -260,7 +257,6 @@ UnqualifiedLookupFactory::UnqualifiedLookupFactory(
260257 M(*DC->getParentModule ()),
261258 Ctx(M.getASTContext()),
262259 Loc(Loc),
263- SM(Ctx.SourceMgr),
264260 DebugClient(M.getDebugClient()),
265261 options(options),
266262 isOriginallyTypeLookup(options.contains(Flags::TypeLookup)),
@@ -328,13 +324,6 @@ void UnqualifiedLookupFactory::lookUpTopLevelNamesInModuleScopeContext(
328324
329325#pragma mark context-based lookup definitions
330326
331- bool UnqualifiedLookupFactory::isInsideBodyOfFunction (
332- const AbstractFunctionDecl *const AFD) const {
333- auto range = Lexer::getCharSourceRangeFromSourceRange (
334- SM, AFD->getBodySourceRange ());
335- return range.contains (Loc);
336- }
337-
338327void UnqualifiedLookupFactory::ResultFinderForTypeContext::findResults (
339328 const DeclNameRef &Name, NLOptions baseNLOptions,
340329 const DeclContext *contextForLookup,
@@ -794,12 +783,6 @@ bool ASTScopeDeclGatherer::consume(ArrayRef<ValueDecl *> valuesArg,
794783// TODO: in future, migrate this functionality into ASTScopes
795784bool ASTScopeDeclConsumerForUnqualifiedLookup::lookInMembers (
796785 const DeclContext *scopeDC) const {
797- if (candidateSelfDC) {
798- if (auto *afd = dyn_cast<AbstractFunctionDecl>(candidateSelfDC)) {
799- assert (factory.isInsideBodyOfFunction (afd) && " Should be inside" );
800- }
801- }
802-
803786 // We're looking for members of a type.
804787 //
805788 // If we started the looking from inside a scope where a 'self' parameter
0 commit comments