-
Notifications
You must be signed in to change notification settings - Fork 30
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
Unable to modify
nested case class
#418
Comments
It should. This is definitely a bug. Thanks for reporting. |
Released as 0.8.1 |
There is some problem with sonatype:
The release will probably fail. I will retry it later in the evening. |
It's also possible that the release succeeded, but the job failed. Better to check on central if it's there :) |
Good news, it does look like the release succeeded, I am able to pull it from maven central in my build.sbt. Not so good news, though the error is no longer thrown, it still doesn't look like things work as expected. For example (substituting the def diff(other: Person) = {
val add =
Diff.summon[Address]
.ignore(_.house)
val d =
Diff.summon[Person]
.modify(_.address)
.setTo(add)
d.apply(this, other)
} and running the example val a1 = Address(123, "Robin St.")
val a2 = Address(456, "Robin St.")
val p1 = Person("Mason", a1)
val p2 = Person("Mason", a2)
println {
p1.diff(p2).isIdentical
} prints |
We clearly miss some test cases for those. Thanks I will look into that. |
All good, let me know if there is anything I can do to help :) |
I found a fix for your case but I also dig a little bit more into that issue and I found countless other edge-cases that would not work even we this new fix applied. This is a design problem and I need to think about that more... |
I released another fix as 0.8.2 It should solve your problem but that is not a complete solution to that issue as there are still some edge cases where it will not work. I have an idea how to fix it completely but I need to rethink how to approach it. |
Given the following simple example:
we are receiving the following stack trace
Does
diffx
support modification of nested case class parameters? If I instead provideDiff.useEquals[Address]
instead of the automically derived instance, the example runs successfully.The text was updated successfully, but these errors were encountered: