Skip to content

Instantly share code, notes, and snippets.

@dgouyette
Created January 10, 2014 19:26
Show Gist options
  • Save dgouyette/8360837 to your computer and use it in GitHub Desktop.
Save dgouyette/8360837 to your computer and use it in GitHub Desktop.
Macro et alias de type
case class CartLine(id: Option[Long], start: DateTime, end: DateTime, saisonId: Long, chambreId: Long, quantity: Int, unityPrice: BigDecimal, tax: BigDecimal, cartId: Option[Long])
case class Cart(id: Option[Long], createdAt: DateTime)
object Cart {
type CartWithLine = (Cart, List[CartLine])
}
implicit val cartLineFormat = Json.format[CartLine]
implicit val cartWithLineFormat = Json.format[CartWithLine]
@dgouyette
Copy link
Author

No apply function found matching unapply parameters
[error] implicit val cartWithLineFormat = Json.format[CartWithLine]

@mathieuancelin
Copy link

C'est pas parce que ca marche qu'avec les case class ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment