-
-
Notifications
You must be signed in to change notification settings - Fork 100
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
fix: enable UUID field overrides with patch #687
Conversation
Probably the same problem as with #683 and would require similar fix to #684 - since
I would have to be debugged with
but that's just a quick guess. Other option might be that Patcher's Implicit/Subtyping rule should be special cased for this example, like a few other rules. |
Cheers. I'll try to look into this myself in the next couple of days |
.../internal/compiletime/derivation/transformer/rules/TransformProductToProductRuleModule.scala
Outdated
Show resolved
Hide resolved
@MateuszKubuszok this is the best working fix that I could manage on the issue... let me know what you think, or if there's a better solution that strikes you. |
If it pass all tests, then it's good. :) Thank you! |
Brilliant! Thanks for the prompt review and release! 🙏 |
There seems to have been a regression in the 1.7.x release, where patching a UUID field failed compilation. The problem is not limited to UUIDs, but applies to patches where a field is any pojo class with a single constructor and no matching accessors.
The fix I've proposed here is
not an elegant one, but it does seem to work; the basic approach is just to forbid TransformProductToProductRule from applying where From <:< Toactually pretty elegant, we just perform the last subtype rule on patches before the product rule