Accepted answer

I think you also need to bound your type in your format like this

implicit def format[T <: Location: Format]: Format[ShippingPoint[T]] = (
        (__ \ "location").format[T] and
        (__ \ "type").format[String](exactWordRead("shipping",   "error.route.shipping.type"))
    )(ShippingPoint.apply, unlift(ShippingPoint.unapply))


As said by the compiler, on one side you have,

sealed trait Point[T <: Location]

... and on the other side,

case class ShippingPoint[T](???) extends Point[T]
case class PickupPoint[T](???) extends Point[T]

But nothing in the declarations of ShippingPoint and PickupPoint is proving the type parameter is compatible with the constraint <: Location, required to extend Point.

So you need to fix that.

case class ShippingPoint[T <: Location](???) extends Point[T]
case class PickupPoint[T <: Location](???) extends Point[T]

Related Query

More Query from same tag