For a sealed family (all implementations of a sealed trait
or defined explicit union types), this option enables the automatic
materialization of handlers for the member types.
If used, make sure it cannot lead to type recursion issue
(reason why it's not disabled by default).
import reactivemongo.api.bson.{ BSONDocumentReader, Macros, MacroOptions }
sealedtrait Family
caseclass TypeA(n: Int) extends Family
caseclass TypeB(s: String) extends Family
caseclass TypeC(f: Float) extends Family
val reader: BSONDocumentReader[Family] =
Macros.using[MacroOptions.AutomaticMaterialization].reader[Family]
// Automatically/internally materializes the readers for Type{A,B,C}
For a sealed family (all implementations of a sealed trait or defined explicit union types), this option enables the automatic materialization of handlers for the member types.
If used, make sure it cannot lead to type recursion issue (reason why it's not disabled by default).