[JAVA-4966] Macro for sealed trait failing Created: 16/May/23 Updated: 28/Oct/23 Resolved: 06/Jun/23 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Scala |
| Affects Version/s: | None |
| Fix Version/s: | 4.10.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Istria Kévin | Assignee: | Ross Lawley |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Documentation Changes: | Not Needed |
| Documentation Changes Summary: | 1. What would you like to communicate to the user about this feature? |
| Description |
SummaryThe codec for a sealed trait using macro does not always work. If the sealed trait and the Macro are not defined is the same module, we have the following error `No known subclasses of the sealed trait` How to Reproducemongo-scala-driver 4.9.1 scala 2.13.10 Define a sealed trait in a module and use the Macro in a an another module.
To fix this issue, we can change the method `isCaseClass` in `org.mongodb.scala.bson.codecs.macrocodecs.CaseClassCodec`:
|
| Comments |
| Comment by Ross Lawley [ 06/Jun/23 ] |
|
Thanks istria.kevin@gmail.com for the report and the fix. |
| Comment by Githook User [ 06/Jun/23 ] |
|
Author: {'name': 'Kévin Istria', 'email': '35448966+kistria@users.noreply.github.com', 'username': 'kistria'}Message: |
| Comment by Cloud GitHub Webhooks [ 06/Jun/23 ] |
|
rozza merged a pull request (JAVA-4966 Fix Macro for sealed trait) into the following branch: |
| Comment by Jeffrey Yemin [ 19/May/23 ] |
|
Thanks for bringing this to our attention, istria.kevin@gmail.com. Since you seem to have found the root cause, feel free to open a pull request to fix this issue, and we can take a look. |
| Comment by PM Bot [ 16/May/23 ] |
|
Hi istria.kevin@gmail.com, thank you for reporting this issue! The team will look into it and get back to you soon. |