@@ -100,8 +100,7 @@ namespace {
100
100
ModuleDecl &M;
101
101
const ASTContext &Ctx;
102
102
const SourceLoc Loc;
103
- const SourceManager &SM;
104
-
103
+
105
104
// / Used to find the file-local names.
106
105
DebuggerClient *const DebugClient;
107
106
@@ -152,8 +151,6 @@ namespace {
152
151
153
152
#pragma mark context-based lookup declarations
154
153
155
- bool isInsideBodyOfFunction (const AbstractFunctionDecl *const AFD) const ;
156
-
157
154
// / For diagnostic purposes, move aside the unavailables, and put
158
155
// / them back as a last-ditch effort.
159
156
// / Could be cleaner someday with a richer interface to UnqualifiedLookup.
@@ -260,7 +257,6 @@ UnqualifiedLookupFactory::UnqualifiedLookupFactory(
260
257
M(*DC->getParentModule ()),
261
258
Ctx(M.getASTContext()),
262
259
Loc(Loc),
263
- SM(Ctx.SourceMgr),
264
260
DebugClient(M.getDebugClient()),
265
261
options(options),
266
262
isOriginallyTypeLookup(options.contains(Flags::TypeLookup)),
@@ -328,13 +324,6 @@ void UnqualifiedLookupFactory::lookUpTopLevelNamesInModuleScopeContext(
328
324
329
325
#pragma mark context-based lookup definitions
330
326
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
-
338
327
void UnqualifiedLookupFactory::ResultFinderForTypeContext::findResults (
339
328
const DeclNameRef &Name, NLOptions baseNLOptions,
340
329
const DeclContext *contextForLookup,
@@ -794,12 +783,6 @@ bool ASTScopeDeclGatherer::consume(ArrayRef<ValueDecl *> valuesArg,
794
783
// TODO: in future, migrate this functionality into ASTScopes
795
784
bool ASTScopeDeclConsumerForUnqualifiedLookup::lookInMembers (
796
785
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
-
803
786
// We're looking for members of a type.
804
787
//
805
788
// If we started the looking from inside a scope where a 'self' parameter
0 commit comments