问题
Working with the Play Framework's JSON Library, I'm creating a Format[T]
for some class T.
val a: JsPath = (JsPath \ "age")
val b: Format[Int] = (JsPath \ "age").format[Int]
val x: FunctionalBuilder[OFormat]#CanBuild2[Int, String] = (
(JsPath \ "age").format[Int] and
(JsPath \ "location").format[String]
)
Looking at the explicit types, we see that (in x
) calling Format[Int] and Format[String]
returns a type of FunctionalBuilder[OFormat]#CanBuild2[Int, String]
.
How does this conversion occur in the Play Framework JSON Library source?
来源:https://stackoverflow.com/questions/21964407/implicit-resolution-in-play-framework-json-library