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

Attempt to canonicalize enum constants #70

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

swankjesse
Copy link
Collaborator

No description provided.

Copy link

@oldergod oldergod left a comment

Choose a reason for hiding this comment

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

No way to test this?

* It's possible we'll see two different [IrEnumEntrySymbol] instances for the same enum constant.
* This returns a canonical instance by looking up the enum by its name in this [IrPluginContext].
*
* https://kotlinlang.slack.com/archives/C7L3JB43G/p1732121246270569
Copy link
Collaborator

Choose a reason for hiding this comment

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

You seem to not be following their advice, though. Seems like we could actually just be using the name to track the default (rather than fully-qualified name) since we know the type will always match.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Lemme switch to just the name!

@swankjesse
Copy link
Collaborator Author

I couldn’t reproduce the problem in a test. When I attached the debugger to the compiler plug-in, it showed this problem for only 1 of 3 symbols, and I didn’t dig into why they were different. That seemed . . . difficult?

@swankjesse swankjesse merged commit 4bb758d into main Nov 20, 2024
1 check passed
@swankjesse swankjesse deleted the jwilson.1120.attempt_canonicalize branch November 20, 2024 19:12
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