Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[1.1.0-RC5] Regression using AutomaticMaterialization on class with optional fields

21 views
Skip to first unread message

Manuel Ahumada

unread,
Jun 4, 2024, 4:21:28 PM6/4/24
to ReactiveMongo - http://reactivemongo.org
Hi, I'm having this error when trying to update to the last version:

[error] src/main/scala/Main.scala:8:23: No matching apply/unapply found: String
[error]     Macros.handlerOpts[Foo, AutomaticMaterialization]
[error]                                         ^

I found that this started on the version 1.1.0-RC5 from reactivemongo-bson-api, in 1.1.0-RC4 it works fine.

It can be reproduced with the following code:

import reactivemongo.api.bson.MacroOptions.AutomaticMaterialization
import reactivemongo.api.bson.Macros

object Main {
  case class Foo(bar: Option[String])

  def main(): Unit = {
    Macros.handlerOpts[Foo, AutomaticMaterialization]
  }
}

This fails to compile, but if you downgrade version or remove the Option field, it works fine.
Is this expected and I should be doing it in another way now or is an error?

Thanks!
Manuel

Cédric Chantepie

unread,
Jul 5, 2024, 11:56:58 AM7/5/24
to ReactiveMongo - http://reactivemongo.org
Try latest RC

Manuel Ahumada

unread,
Jul 5, 2024, 1:24:18 PM7/5/24
to ReactiveMongo - http://reactivemongo.org
I forgot to add it, but I can also reproduce it on the latest RC12
Reply all
Reply to author
Forward
0 new messages