Skip to content

[Module-scope lookup] Only add macro-expanded names that match. #64967

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

Conversation

DougGregor
Copy link
Member

When we look into expanded macros to find declarations for module-scope name lookup, make sure that we only return declarations whose name matches the requested name.

We were effectively spamming the results with unrelated names, and most clients trust the results of this lookup (vs. filtering them further), so they would get confused. The particular failure for this test is that type reconstruction would fail because we were looking for one unique name, but we found many non-matching names, and type reconstruction bails out rather than try to filter further.

When we look into expanded macros to find declarations for module-scope
name lookup, make sure that we only return declarations whose name
matches the requested name.

We were effectively spamming the results with unrelated names, and
most clients trust the results of this lookup (vs. filtering them
further), so they would get confused. The particular failure for this
test is that type reconstruction would fail because we were looking
for one unique name, but we found many non-matching names, and type
reconstruction bails out rather than try to filter further.
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit 4f8808d into swiftlang:main Apr 6, 2023
@DougGregor DougGregor deleted the name-lookup-filtering-expanded-top-level branch April 6, 2023 13:47
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