Skip to content

[Completion] Better handle merging of lookup base types #74180

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 1 commit into from
Jun 7, 2024

Conversation

hamishknight
Copy link
Contributor

For unresolved member completion, we were preferring the more general type, when we ought to be preferring the more specific type. Additionally, for both unresolved member and postfix completion we were opening archetypes, which doesn't work as expected since we don't compare requirements. Factor out the logic that deals with merging base types for lookup, and have it prefer either the subtype, or the optional type in the case of optional promotion.

rdar://126168123

@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight
Copy link
Contributor Author

@swift-ci please SourceKit stress test

Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice

For unresolved member completion, we were preferring
the more general type, when we ought to be preferring
the more specific type. Additionally, for both
unresolved member and postfix completion we were
opening archetypes, which doesn't work as expected
since we don't compare requirements. Factor out
the logic that deals with merging base types for
lookup, and have it prefer either the subtype, or
the optional type in the case of optional promotion.

rdar://126168123
@hamishknight hamishknight force-pushed the complete-conversion branch from 32a02f5 to 30af99e Compare June 7, 2024 09:04
@hamishknight
Copy link
Contributor Author

@swift-ci please smoke test

@hamishknight hamishknight enabled auto-merge June 7, 2024 09:04
@hamishknight hamishknight merged commit 1c58d8b into swiftlang:main Jun 7, 2024
3 checks passed
@hamishknight hamishknight deleted the complete-conversion branch June 7, 2024 14:58
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.

3 participants