Skip to content

Retain invalid decls when filtering using access path #34455

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 2 commits into from
Nov 2, 2020

Conversation

bnbarham
Copy link
Contributor

Fixes missing declarations in the completions list due to their type
being invalid.

Resolves rdar://70704835

@bnbarham bnbarham requested a review from rintaro October 27, 2020 03:44
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1ec88cd77f2b8b76e885f098ebe36ad6e9bed4d6

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1ec88cd77f2b8b76e885f098ebe36ad6e9bed4d6

@bnbarham
Copy link
Contributor Author

Not sure why OSX failed. Linux also had an unrelated test failure. Windows (surprisingly) is the only platform that has just the relevant test failure: completion in the initializer of a top level decl shouldn't include the decl itself.

There's a bug for including the decl when it's the first decl, but this change appears to regress that case to happening on every top level decl. This is probably worse than just missing the decl when it's invalid, so I'll look into fixing that first.

rintaro
rintaro previously approved these changes Oct 27, 2020
@rintaro
Copy link
Member

rintaro commented Oct 27, 2020

@swift-ci Please smoke test

@rintaro
Copy link
Member

rintaro commented Oct 27, 2020

@swift-ci Please test Windows

@rintaro rintaro dismissed their stale review October 28, 2020 17:31

There's a regression

@bnbarham bnbarham force-pushed the benb/decl-filter-70704835 branch from 1ec88cd to 26c3545 Compare October 29, 2020 06:16
@bnbarham bnbarham changed the title [NameLookup] Retain invalid decls when filtering using access path Retain invalid decls when filtering using access path Oct 29, 2020
@bnbarham
Copy link
Contributor Author

I've updated the PR, adding another commit that remove the decl from the completion list when the completion is within its initializer.

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@rintaro rintaro requested a review from benlangmuir October 29, 2020 17:28
@bnbarham bnbarham force-pushed the benb/decl-filter-70704835 branch from 26c3545 to 00037b5 Compare October 30, 2020 00:26
@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 00037b5b3bb89311ab79e38429332d927462a5ce

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 00037b5b3bb89311ab79e38429332d927462a5ce

@bnbarham
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 00037b5b3bb89311ab79e38429332d927462a5ce

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 00037b5b3bb89311ab79e38429332d927462a5ce

`::lookupVisibleDecls` had an inline consumer in order to remove
"unusable" results. Refactor this method, moving the consumer (now
`UsableFilteringDeclConsumer`) to allow its use when looking up top
level module declarations.

Also use the `AccessFilteringDeclConsumer` in preference to a condition
in `addVarDecl`.

Resolves rdar://56755598
Fixes missing declarations in the completions list due to their type
being invalid.

Resolves rdar://70704835
@bnbarham bnbarham force-pushed the benb/decl-filter-70704835 branch from 00037b5 to 4da190d Compare November 1, 2020 22:49
@bnbarham
Copy link
Contributor Author

bnbarham commented Nov 1, 2020

@swift-ci please test

@bnbarham
Copy link
Contributor Author

bnbarham commented Nov 2, 2020

@compnerd the Windows builder ran out of space - is it missing some cleanup somewhere?

@rintaro
Copy link
Member

rintaro commented Nov 2, 2020

@swift-ci Please smoke test Windows

@bnbarham bnbarham merged commit 22e083e into swiftlang:main Nov 2, 2020
@bnbarham bnbarham deleted the benb/decl-filter-70704835 branch November 2, 2020 21:51
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.

4 participants