Implicit Resolution in Play Framework JSON Library

夙愿已清 提交于 2019-12-25 02:18:23

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!