import scalaz._, Scalaz._
import argonaut._, Argonaut._
object Minimal {
val list = List(Map("id" -> 1), Map("name" -> "Mr. Name"))
println(list.asJson)
}
给了我
Error:(8, 16) diverging implicit expansion for type argonaut.EncodeJson[A0]
starting with method IMapEncodeJson in trait EncodeJsons
println(list.asJson)
^
Error:(8, 16) diverging implicit expansion for type argonaut.EncodeJson[V]
starting with method IMapEncodeJson in trait EncodeJsons
println(list.asJson)
^
Error:(8, 16) not enough arguments for method asJson: (implicit e: argonaut.EncodeJson[List[scala.collection.immutable.Map[String,Any]]])argonaut.Json.
Unspecified value parameter e.
println(list.asJson)
^
但是,如果我将列表重新定义为
val list = List(Map("id" -> "1"), Map("name" -> "Mr. Name"))
它有效。