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

Manually create LST for enums in MinimumSwitchCases #204

Merged
merged 1 commit into from
Oct 21, 2023

Conversation

knutwannheden
Copy link
Contributor

When the types are not known in advance the JavaTemplate classpath can also not be configured for these types. As a consequence the corresponding elements cannot be properly type-attributed.

So that the result of MinimumSwitchCases is properly type-attributed when transforming a switch over an enum, the recipe now manually creates the LST. Then the ShortenFullyQualifiedTypeReferences visitor also works properly.

When the types are not known in advance the `JavaTemplate` classpath can also not be configured for these types. As a consequence the corresponding elements cannot be properly type-attributed.

So that the result of `MinimumSwitchCases` is properly type-attributed when transforming a `switch` over an enum, the recipe now manually creates the LST. Then the `ShortenFullyQualifiedTypeReferences` visitor also works properly.
@knutwannheden
Copy link
Contributor Author

Going ahead and merging this PR. We can always revert again or alternatively also use the manual LST building for the String and primitive type cases.

@knutwannheden knutwannheden merged commit 5027edb into main Oct 21, 2023
1 check passed
@knutwannheden knutwannheden deleted the minimum-switch-enums branch October 21, 2023 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant