lloydmeta / enumeratum

A type-safe, reflection-free, powerful enumeration implementation for Scala with exhaustive pattern match warnings and helpful integrations.
MIT License
1.18k stars 146 forks source link

allow value constructor param to be any constructor parameter, rather than only the first #398

Closed martijnhoekstra closed 1 day ago

martijnhoekstra commented 2 weeks ago

simplify and correct finding the constructor param index for the value param.

As a follow-up, I want to double-check whether we need to require -Yretain-trees.

Some of the boyscouting here is a matter of taste, if it's not to yours, I'm happy to revert.

codecov-commenter commented 2 weeks ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 85.71%. Comparing base (1fbbd04) to head (3aeaa51).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #398 +/- ## ======================================= Coverage 85.71% 85.71% ======================================= Files 63 63 Lines 511 511 Branches 34 34 ======================================= Hits 438 438 Misses 73 73 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

lloydmeta commented 1 week ago

Thanks for this. I will definitely review this once I have some spare time 🙇‍♂️