Skip to content
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

Support generating a single import for overloaded MemberNames #1909

Merged
merged 2 commits into from
May 20, 2024

Conversation

Egorand
Copy link
Collaborator

@Egorand Egorand commented May 19, 2024

Fixes #1907.

MemberName imports were modeled after TypeName imports, where an import can only represent a single fully-qualified name. However with MemberNames, a single import can represent multiple overloaded members that share a fully-qualified name. While overloaded members can be represented with a single MemberName, we distinguish between extension and non-extension members, and their MemberNames are not equal. We'll currently try to generate import aliases in this case, which is incorrect, and actually impossible, since they have the exact same fully-qualified name (see #1907). This change handles this scenario and adds support for having a single import generated for multiple MemberNames.

  • docs/changelog.md has been updated if applicable.

MemberName imports were modeled after TypeName imports, where an
import can only represent a single fully-qualified name. However
with MemberNames, a single import can represent multiple
overloaded members that share a fully-qualified name. While
overloaded members can be represented with a single MemberName, we
distinguish between extension and non-extension members, and their
MemberNames are not equal. We'll currently try to generate import
aliases in this case, which is incorrect, and actually impossible,
since they have the exact same fully-qualified name (see #1907).
This change handles this scenario and adds support for having a
single import generated for multiple MemberNames.
@Egorand Egorand merged commit 29d409a into main May 20, 2024
8 checks passed
@Egorand Egorand deleted the egor.240519.single-import-multiple-members branch May 20, 2024 06:43
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.

Infinity loop/block when a MemberName is used with isExtension=true and isExtension=false
2 participants