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

Update scala 3 macro to support a hierarchy of sealed traits #371

Merged
merged 1 commit into from
Jul 21, 2023

Conversation

coreywoodfield
Copy link
Contributor

This fixes #368. I wasn't sure how to add/update tests, but I did test it in a sample project locally, and it works as expected. It finds all the instances of the base sealed trait and all the instances of the inheriting sealed trait

@codecov-commenter
Copy link

codecov-commenter commented Jul 19, 2023

Codecov Report

Merging #371 (9792830) into master (74a7b36) will not change coverage.
The diff coverage is n/a.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@           Coverage Diff           @@
##           master     #371   +/-   ##
=======================================
  Coverage   85.52%   85.52%           
=======================================
  Files          65       65           
  Lines         518      518           
  Branches       31       31           
=======================================
  Hits          443      443           
  Misses         75       75           

Copy link
Owner

@lloydmeta lloydmeta left a comment

Choose a reason for hiding this comment

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

Thanks for taking a stab at this.

Regarding tests, it might be good to add something to

class ValueEnumSpec extends AnyFunSpec with Matchers with ValueEnumHelpers {

possibly by adding a sealed trait enum definition in enumeratum-core/src/test/scala/enumeratum/values

@coreywoodfield
Copy link
Contributor Author

I added a test. It fails if I run coreJVM / test as-is and passes if I run coreJVM / test after settings useLocalVersion in build.sbt to true

Copy link
Owner

@lloydmeta lloydmeta left a comment

Choose a reason for hiding this comment

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

LGTM thanks ! I'll merge this once I have some time to push out releases.

Re: having to set the "use local version" flag: that's expected :)

@lloydmeta
Copy link
Owner

Pulled this branch and merged in master locally and ran some basic tests...seems to be good so merging now.

@lloydmeta lloydmeta merged commit 3429387 into lloydmeta:master Jul 21, 2023
@lloydmeta
Copy link
Owner

Thanks for this btw, it has been released as part of https://github.com/lloydmeta/enumeratum/releases/tag/macros-1.6.4

@coreywoodfield coreywoodfield deleted the findvalues-368 branch February 16, 2024 22:28
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.

Scala3: findValues fails to compile in nested sealed trait hierarchy
3 participants