Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jatcwang
Copy link
Collaborator

@jatcwang jatcwang commented Apr 5, 2025

Switch Scala 3 derivation to be based on macros instead of implicit prioritization (MkWrite etc). For Scala 3 this improves compile times significantly, as the MkWrite/MkRead-based derivation seems to be evaluated differently by Scala 3 ("Implicit search problem too large").

  • Move MkWrite/MkRead to Scala 2, as they're no longer needed in Scala 3 derivation implementation
  • Remove fromPutOption/fromGetOption for both Scala 2 and 3 as it's somewhat redundant whe we can get the same result via Put[A] => Read[A], Read[A] => Read[Option[A]].

Resolves #2214 #2241

Switch Scala 3 derivation to be based on macros instead of implicit
prioritization (MkWrite etc). For Scala 3 this improves compile times
significantly, as the `MkWrite/MkRead`-based derivation seems to be
evaluated differently by Scala 3 ("Implicit search problem too large").

- Move MkWrite/MkRead to Scala 2, as they're no longer needed in Scala 3
  derivation implementation
- Remove fromPutOption/fromGetOption for both Scala 2 and 3 as it's
somewhat redundant whe we can get the same result via `Put[A] => Read[A]`, `Read[A] =>
Read[Option[A]]`.

Resolves #2214 #2241

trait LowerPriority2Write extends LowerPriority3Write {
implicit def fromPut[A](implicit put: Put[A]): Write[A] =
new Write.Single(put)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@satorg I removed fromPutOption / fromGetOption :)

@jatcwang jatcwang merged commit 3b2a715 into main Apr 12, 2025
11 checks passed
@jatcwang jatcwang deleted the improve_scala3_derivation branch April 12, 2025 10:36
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.

Derivation of "large" case classes doesn't work in 1.0.0-RC8

2 participants