Skip to content

[AST] Refactor name lookup a bit #18317

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

Merged
merged 3 commits into from
Jul 28, 2018

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Jul 28, 2018

Factor qualified name lookup into a few different entry points:

  • AnyObject lookup (for finding @objc members on an AnyObject instance)
  • Module lookup (when one writes ModuleName.Foo to reference something in a module)
  • Lookup into an array of TypeDecls, which is the core operation we'd expect to use.

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor force-pushed the refactor-name-lookup branch from e435774 to 4d5762e Compare July 28, 2018 04:48
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

AnyObject lookup is a completely separate path from normal qualified
lookup, so separate it out and pull out the common bits.
The “name lookup into a module” lookup is completely different from
performing name lookup into a type. Factor it out into its own
utility routine.
Make the core lookupQualified() API accept an array of TypeDecls in which
it should look, rather than looking into a Type. This is in preparation
for breaking more type-checker dependencies in the name lookup code.
@DougGregor DougGregor force-pushed the refactor-name-lookup branch from 4d5762e to 48fb227 Compare July 28, 2018 06:22
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

1 similar comment
@DougGregor
Copy link
Member Author

@swift-ci please smoke test and merge

@swift-ci swift-ci merged commit 834ad9e into swiftlang:master Jul 28, 2018
@DougGregor DougGregor deleted the refactor-name-lookup branch July 28, 2018 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants