-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Remove FindLocalVal #71357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove FindLocalVal #71357
Conversation
Yes! |
543fb81
to
e6ede36
Compare
@swift-ci please test |
@swift-ci please SourceKit stress test |
auto *SF = DC->getParentSourceFile(); | ||
assert(SF); | ||
assert(Loc.isValid()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any objections to requiring a valid SourceLoc and SourceFile? We could potentially fall back to a module-scope lookup, but it's not clear to me how useful such a behavior would be (seems like callers ought to use lookupVisibleDeclsInModule
if that's what they really want), and it seems like all the current clients meet this requirement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No objection. Maybe we should even add
assert(DC->isModuleScopeContext());
because without IncludeTopLevel: true
, that lookup doesn't make any sense. If the caller really wants only top-level decls, they usually should use ModuleDecl::lookupVisibleDecls()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Presumably you mean assert(!DC->isModuleScopeContext());
? Looks like that can be hit for e.g decl attribute completion, and I think seems reasonable to have a module scope context there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. But just out of curiosity, does swift::lookupVisibleDecls()
at SourceFile
context without IncludeTopLevel
emit anything?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it doesn't include anything
Same stress tester failures as main, except for |
e6ede36
to
f648d32
Compare
This includes local types, so make the name a bit more generic.
Replace with an ASTScope lookup. This also lets us simplify UsableFilteringDeclConsumer, and fixes a couple of completion bugs.
f648d32
to
f4b928f
Compare
@swift-ci please test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm!
Replace with an ASTScope lookup. This also lets us simplify UsableFilteringDeclConsumer, and fixes a couple of completion bugs.
Resolves #66925
Resolves #71384
rdar://92479209
rdar://108164277
rdar://122302481