scalalandio / chimney

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

Support nested patchers that look for implicits #133

Open krzemin opened 4 years ago

krzemin commented 4 years ago

Following this comment, https://github.com/scalalandio/chimney/issues/69#issuecomment-456360446 current implementation of patchers macro doesn't look for loca implicit instances. It neither call itself recursively in order to support following example:

case class Bar(a: Int, b: Boolean)
case class Foo(x: Bar, y: String)

case class BarPatch(a: Int)
case class FooPatch(x: BarPatch)

Foo(Bar(1, true), "test").patchUsing(FooPatch(BarPatch(2))) 
// should be Foo(Bar(5, true), "test")
MateuszKubuszok commented 2 months ago

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