Skip to content

Possible to improve error message in case object hierarchy isn't sealed? #54

Description

@Woodz

Currently, the compiler error message produced in case the ADT hierarchy isn't fully sealed is not very self-explanatory. It would be great if this could be improved to help users debug issues faster.

For example (note that SuperFoo is not sealed):
`sealed trait Foo

trait SuperFoo extends Foo

case class Bar(x: Int) extends Foo

case class Baz(s: String) extends SuperFoo

case object Bah extends Foo

implicit val fooFormat: OFormat[Foo] = flat.oformat((__ \ "type").format[String])
`

Fails to compile with:
Error:(16, 58) could not find Lazy implicit value of type julienrf.json.derived.DerivedReads[A] Error occurred in an application involving default arguments. lazy implicit val fooFormat: OFormat[Foo] = flat.oformat((__ \ "type").format[String]) ^ which is not obviously caused by an unsealed ADT hierarchy

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions