Cross-posting Form mappings in Scala3 - CaseClass.unapply no longer usable? · playframework · Discussion #12292 · GitHub
Play framework’s form handling makes heavy use of the CaseClass.unapply
method and depends on its signature being CaseClass => Option[(...)]
.
Scala 3’s change to the unapply
method’s signature breaks this style of usage, since the unapply
method now just returns the case class instance instead of an option of a tuple:
object Foo {
def unapply(foo: Foo): Option[(...)] = ... // <- Scala 2
def unapply(foo: Foo): Foo = foo // <- Scala 3
}
Any suggestions for how to proceed here? Any pointers on how to write a macro?