Skip to content

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
@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.

2 participants