You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been trying for hours to get some code to compile and about to give up on spray-json as I'm having no luck. I'm trying to get rid of the error:
Error:(18, 24) Cannot find JsonWriter or JsonFormat type class for com.intertrust.modulus.services.audit.Event
val result = e.toJson
I've used spray-json for years and am always confounded by errors such as this, and seek some methodology for debugging these and isolating WHY I get these occasionally when I'm pretty certain that I have implicit json formatters in-scope for all the case classes that extend the base trait (here Event).
When the hierarchy is:
trait Event extends Product with Serializable
sealed trait AccountEvent extends Event
case class AccountAdded(name: String, password: String) extends AccountEvent
case class AccountDeleted(name: String) extends AccountEvent
case class AccountPasswordChanged(name: String, password: String) extends AccountEvent
sealed trait FooEvent extends Event
case class FooEvent1() extends FooEvent
The compiler should be able to find that the ONLY types that extend Event are those case classes (since the trait from which they derive is sealed). So why can't it find the implicit jsonFormatter I have defined in a trait that is extended by the class in which the error is occurring?
The text was updated successfully, but these errors were encountered:
I've been trying for hours to get some code to compile and about to give up on spray-json as I'm having no luck. I'm trying to get rid of the error:
I've used spray-json for years and am always confounded by errors such as this, and seek some methodology for debugging these and isolating WHY I get these occasionally when I'm pretty certain that I have implicit json formatters in-scope for all the case classes that extend the base trait (here Event).
When the hierarchy is:
The compiler should be able to find that the ONLY types that extend Event are those case classes (since the trait from which they derive is sealed). So why can't it find the implicit jsonFormatter I have defined in a trait that is extended by the class in which the error is occurring?
The text was updated successfully, but these errors were encountered: