在游戏框架JSON库的隐式解析(Implicit Resolution in Play Framew

2019-10-19 09:50发布

与游戏框架的JSON图书馆工作,我创建一个Format[T]对于一些类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]
       )

纵观明确的类型,我们看到,(在x )调用Format[Int] and Format[String]返回一个类型的FunctionalBuilder[OFormat]#CanBuild2[Int, String]

请问这个转换发生在游戏框架JSON库源?

文章来源: Implicit Resolution in Play Framework JSON Library