scala play json Keine unapply oder unapplySeq Funktion gefunden

Dieses Beispiel für eine automatisierte JSON-Zuordnung in der Wiedergabedokumentation schlägt fehl. Warum?https: //www.playframework.com/documentation/2.5.x/ScalaJsonAutomate

libraryDependencies += "com.typesafe.play" %% "play" % "2.5.0"
---
import play.api.libs.json._
case class Resident(name: String, age: Int, role: Option[String])
implicit val residentWrites = Json.writes[Resident]
println(Json.toJson(Resident("john", 33, None)))
---
Error: No unapply or unapplySeq function found
      implicit val residentWrites = Json.writes[Resident]

Antworten auf die Frage(2)

Ihre Antwort auf die Frage