Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Woodz opened this issue Aug 18, 2017 · 0 comments
Open

Comments

@Woodz
Copy link

Woodz commented Aug 18, 2017

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant