The following code works with Scala 2.13 (see https://stackoverflow.com/a/59996748/2750966):
import io.circe.generic.semiauto._
case class Name(name: String)
case class QueryResult[T: Decoder](data: T)
implicit val nameDer = deriveDecoder[Name]
implicit def result[T: Decoder] = deriveDecoder[QueryResult[T]]
In Scala 3 I get the following Compile Exception:
no implicit argument of type deriving.Mirror.Of[RestEndpoint.this.QueryResult[T]] was found for parameter A of method deriveDecoder in package camundala.bpmn
implicit def result[T: Decoder]: Decoder[QueryResult[T]] = deriveDecoder[QueryResult[T]]
Is this not yet supported or has there something changed?
It looks like Scala 3 can't generate a
Mirrorfor case classes with multiple parameter lists. I don't know if this is a documented limitation.Your case class
QueryResulthas a secondary parameter list because of the context bound onDecoder. Are you sure that you actually need that context bound? IdeallyQueryResultshouldn't store any decoders, or even concern itself with decoders at all.The following works: