Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested patchers don't work with subset of fields #119

Open
joroKr21 opened this issue Oct 28, 2019 · 1 comment
Open

Nested patchers don't work with subset of fields #119

joroKr21 opened this issue Oct 28, 2019 · 1 comment
Labels
blocked Ticket cannot be implemented because it depends on another ticker or external factor dragons ahead Task which requires handwriting compiletime reflection for Scala2&3 and/or updating the architecture enhancement

Comments

@joroKr21
Copy link
Contributor

It's ok to patch a subset of fields on the top level, but not on deeper levels.

  import io.scalaland.chimney.dsl._
  case class Foo(x: Int, y: String)
  case class FooPatch(x: Int)
  case class Bar(foo: Foo, z: Long)
  case class BarPatch(foo: FooPatch)
  val foo = Foo(1, "2")
  val bar = Bar(foo, 3)
  val fooPatch = FooPatch(4)
  val barPatch = BarPatch(fooPatch)
  foo.patchWith(fooPatch) // ok
  bar.patchWith(barPatch) // y: java.lang.String - no accessor named y in source type FooPatch

Awesome library btw 👍

@MateuszKubuszok MateuszKubuszok added the dragons ahead Task which requires handwriting compiletime reflection for Scala2&3 and/or updating the architecture label Oct 20, 2023
@MateuszKubuszok MateuszKubuszok added this to the Merge transformations milestone Dec 19, 2023
@MateuszKubuszok
Copy link
Member

Depends on #538 which in turns depends on #115.

@MateuszKubuszok MateuszKubuszok added the blocked Ticket cannot be implemented because it depends on another ticker or external factor label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked Ticket cannot be implemented because it depends on another ticker or external factor dragons ahead Task which requires handwriting compiletime reflection for Scala2&3 and/or updating the architecture enhancement
Projects
None yet
Development

No branches or pull requests

2 participants