score:1
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))
score:2
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]
Source: stackoverflow.com
Related Query
- Play 2.4 parameterized algebraic data types JSON validation
- What is the difference between Abstract Data Types and Algebraic Data Types
- Custom JSON validation constraints in Play Framework 2.3 (Scala)
- Are there algebraic data types outside of sum and product?
- "Composite" algebraic data types in Scala and Haskell
- Scala Play Json JSResultException Validation Error
- scala play 2.1.1 json functional syntax mapping data to a different format
- Play Framework WS: Returning JSON data as Int
- Play framework scala json validation exception
- Play 2.3.x Scala - How to display json data on view?
- Is there a json validation framework in play based on a specified grammar
- Scala - parse JSON data from API with ScalaJson Play Framework
- How to generate algebraic data types in scala using scalaPB
- Play - Json deserialization of data type Map[X,List[Y]]
- Play Framework JSON automated mapping with custom validation
- Validation Only With Play Json
- Play Json Validation is failing on Date field with Error: [error.expected.date.isoformat]
- scala play json custom validation oneOf
- How to suppress the Play framework's output of data types in forms
- Handling json data with angularjs on play scala 2.3.4
- Scala Algebraic Data Types for file extension to format mapping
- Play Framework Json validation that needs to check database
- Scala: Refined Algebraic Data Types
- How to define an implicit deserializer using Play Json for generic types
- Play JSON Reads: read value which can be presented in multiple types
- Put Data in mutlple branch of Array : Json Transformer ,Scala Play
- Scala Play Framework, combine Json validation constrains?
- How to insert json fixture data in Play Specification tests?
- Play 2.1 Scala - JSON - Symmetric Format object with nested data structure not serializing correctly
- extracting data from JSON for a given path using Play JSON
More Query from same tag
- Instantiate case class with values to be set for its members
- Scala implicit conversion from Array[T] to IndexedSeq[T]
- Scala: wake up sleeping thread
- Is there or will there be a Scala collection extending Seq with faster iteration than Array?
- Scala List: Why does this List operation work?
- What's the difference between object in scalajs scope and *same* object in js.global scope?
- how to understand scala placeholder
- Object creation impossible error when trying to override getListCellRenderComponent method in scala
- Spark throws Not Serializable Exception inside a foreachRDD operation
- "null" columns while creating derived column using withColumns
- read csv file(numeric type) in scala
- What's the best practice of simple Slick INSERT/GET?
- Roles of sbt-idea and Idea sbt plugin
- Programming Language independent Model Validation
- Scala pattern matching and type inference
- Cannot deserialize a generic collection using spray-json
- Functional way to build a matrix from the list in scala
- Kryo cannot serialize a java.sql.Timestamp?
- Kafka partition key not working properly‏
- Scala and Java in same project
- How can I print the contents of a org.squeryl.dsl.Group?
- Why is Scala's Addable deprecated?
- Getting the first item for a tuple for each row in a list in Scala
- How can I use acknowledgment semantics in a Flow?
- Scala parallel file download
- Pattern matching custom implementation of List ADT
- Immutable covariant collection with uniqueness
- Unknown Error from SBT console for dispatch-Http Get request
- Read input file from jar while running application from spark-submit
- How to specify a dynamic input and output path for Spark - in a typesafe config file?