Skip to content

Conversation

@jadenPete
Copy link
Contributor

Fixes #318 and #447

@jadenPete jadenPete force-pushed the jpeterson-support-default-parameter-values-and-multiple-parameter-lists-in-scala-3 branch from 2983aaf to 640e049 Compare January 2, 2026 19:31
@codecov-commenter
Copy link

⚠️ 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.
✅ Project coverage is 85.71%. Comparing base (df6a1dd) to head (640e049).
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for value enum entries with default parameter values and/or multiple parameter lists, addressing issues #318 and #447.

  • Refactored macro implementations for both Scala 2 and Scala 3 to preserve parameter list structure instead of flattening
  • Added recursive helper functions to properly traverse nested constructor applications
  • Added test coverage for both new features (multiple parameter lists and default parameters)

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.

Show a summary per file
File Description
macros/src/main/scala-3/enumeratum/ValueEnumMacros.scala Updated valueParamIndexOf to return 2D indices for parameter lists; added getConstructorTypeAndArguments to recursively handle multiple parameter lists and default parameters via Block nodes
macros/src/main/scala-2/enumeratum/ValueEnumMacros.scala Added getConstructorTypeAndArguments helper; updated findConstructorParamsLists to preserve parameter list structure instead of flattening
macros/compat/src/main/scala-2.13/enumeratum/ContextUtils.scala Removed obsolete constructorsToParamNamesPF function that was flattening parameter lists
macros/compat/src/main/scala-2.12/enumeratum/ContextUtils.scala Removed obsolete constructorsToParamNamesPF function that was flattening parameter lists
enumeratum-core/src/test/scala/enumeratum/values/ValueEnumSpec.scala Added test cases for multiple parameter lists and default parameters; minor syntax cleanup
enumeratum-core/src/test/scala/enumeratum/values/IntTransformation.scala Test fixture demonstrating value enums with multiple parameter lists
enumeratum-core/src/test/scala/enumeratum/values/Creature.scala Test fixture demonstrating value enums with default parameter values

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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. Will merge once I have time to release.

@lloydmeta lloydmeta added this to the 1.9.3 milestone Jan 10, 2026
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.

Multiple parameter lists on an Entry implementation can break the constant value check

3 participants