scalalandio / chimney

Scala library for boilerplate-free, type-safe data transformations
https://chimney.readthedocs.io
Apache License 2.0
1.15k stars 91 forks source link

Attempt to fix Scala 3 enum in snippet.sc, instead reproduce an issue with TypeRepr.of[A].memberType(subtype) #533

Closed MateuszKubuszok closed 2 months ago

MateuszKubuszok commented 3 months ago

When Scala CLI snippet.sc is used macro generates assertion errors when Scala 3 enum is used:

Once this is solved, all Scala 3 snippets in documentation with enums - which required:

@main def example: Unit = {
// actual code
}

can have the workaround removed.

See:

for the context (and why it's not so easy to "just fix in in the library").

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 89.53%. Comparing base (35f50d4) to head (7e16b56). Report is 7 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #533 +/- ## ========================================== + Coverage 87.72% 89.53% +1.81% ========================================== Files 136 104 -32 Lines 5440 2589 -2851 Branches 438 243 -195 ========================================== - Hits 4772 2318 -2454 + Misses 668 271 -397 ```

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

MateuszKubuszok commented 3 months ago

I might consider some workaround where we'd fetch m: scala.deriving.Mirror.SumOf[A] and extract subtypes from m.MirroredElemLabels, but it has its own corner cases.

MateuszKubuszok commented 2 months ago

Until it's fixed in upstream it makes no sense to work on this issue. When it will, then we might need to start from scratch anyway, so closing for now.