You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Cannot find or construct a Read instance for type: com.test.Main.DataWrapper2
But derivation works with simple Read[NewTypeWrapper]
package com.test
import doobie._
import doobie.postgres.implicits._
import io.estatico.newtype.macros.newtype
object Main extends App {
@newtype case class NewTypeWrapper(value: Int)
object NewTypeWrapper {
implicit val read: Read[NewTypeWrapper] = Read[Int].map(NewTypeWrapper(_))
}
case class DataWrapper(one: NewTypeWrapper)
case class DataWrapper1(list: List[Int])
case class DataWrapper2(list: List[NewTypeWrapper])
val t = NewTypeWrapper(1)
println(Read[NewTypeWrapper])
println(Read[DataWrapper])
println(Read[DataWrapper1])
println(Read[DataWrapper2])
}
The text was updated successfully, but these errors were encountered:
Read not derived, next code results in such error
Cannot find or construct a Read instance for type: com.test.Main.DataWrapper2
But derivation works with simple Read[NewTypeWrapper]
The text was updated successfully, but these errors were encountered: