scalalandio / chimney

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

Wrong case picked for simple enums transformation #625

Open sake92 opened 2 days ago

sake92 commented 2 days ago

Checklist

Describe the bug

Wrong case picked for simple enums transformation.

Reproduction

https://scastie.scala-lang.org/NOZPnNesSCCSUkUhseB4kQ

//> using scala 3.5.0
//> using dep io.scalaland::chimney::1.4.0

import io.scalaland.chimney.dsl.*

// picks 'solo' instead of 'school' case...
println(
  Enum1.school.transformInto[Enum2]
)

enum Enum1:
  case solo, team, school

enum Enum2:
  case solo, team, school

If posting a snippet, test it first with scala-cli run --server=false .!

Expected behavior

Pick the "school" case.

Actual behavior

Picks the "solo" case.

Which Chimney version do you use

1.4.0

Which platform do you use

If you checked JVM

Which JVM distribution do you use (you can provide java -version output).

Additional context

Add any other context about the problem here.

MateuszKubuszok commented 2 days ago

Duplicate of https://github.com/scalalandio/chimney/issues/479 - the fix made by @jchyb was merged to master, but not yet released. Meanwhile you can check with snapshots.

sake92 commented 2 days ago

Oh, I couldnt find that issue..
Thanks for great work btw!

MateuszKubuszok commented 2 days ago

Released in 1.5.0

sake92 commented 1 day ago

@MateuszKubuszok still doesn't work https://scastie.scala-lang.org/nJrMeOd1QeiWKOJk9qG01A 😢

MateuszKubuszok commented 1 day ago

In such case I have no idea how to fix it. CC @jchyb