Recently, I am reading the source code of Spray-json. I noted that the following hierarchy relation in JsonFormat.scala
, please see below code snippet
/**
* A special JsonFormat signaling that the format produces a legal JSON root
* object, i.e. either a JSON array
* or a JSON object.
*/
trait RootJsonFormat[T] extends JsonFormat[T] with RootJsonReader[T] with RootJsonWriter[T]
To express the confusion more convenient, I draw the following diagram of hierarchy:
According to my limited knowledge of Scala, I think the JsonFormat[T] with
should be removed from the above code. Then I cloned the repository of Spary-json, and comment the code JsonFormat[T] with
trait RootJsonFormat[T] extends RootJsonReader[T] with RootJsonWriter[T]
Then I compile it in SBT(use package/compile
command) and it passed to the compiling process and generates a spray-json_2.11-1.3.4.jar
successfully.
However, when I run the test cases via test
command of SBT, it failed.
So I would like to know why. Thanks in advance.