Last active
November 27, 2023 14:28
-
-
Save mrdziuban/936a8d2787c0ccce369af9cc26ba4229 to your computer and use it in GitHub Desktop.
semiauto-sealed-trait-option1.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sealed trait Test1 | |
object Test1 { | |
case object Member extends Test1 | |
} | |
sealed trait Test2 | |
object Test2 { | |
sealed trait SubTrait extends Test2 | |
case object Member extends SubTrait | |
} | |
sealed trait Test3 | |
object Test3 { | |
case class Member() extends Test3 | |
} | |
// all of these fail because there are no `Decoder`s for the subtype object/class/trait | |
io.circe.Decoder.derived[Test1] | |
io.circe.Decoder.derived[Test2] | |
io.circe.Decoder.derived[Test3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment