Skip to content

Commit

Permalink
A test that reproduces a bug which is reported in the #551 issue
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Jun 24, 2020
1 parent 517c851 commit db52782
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1878,16 +1878,18 @@ class JsonCodecMakerSpec extends VerifyingSpec {

sealed trait GADT2[A] extends Product with Serializable

case class IsDir(path: String) extends GADT2[_root_.scala.Boolean]
object GADT2 {
case class IsDir(path: String) extends GADT2[_root_.scala.Boolean]

case class Exists(path: String) extends GADT2[_root_.scala.Boolean]
case class Exists(path: String) extends GADT2[_root_.scala.Boolean]

case class ReadBytes(path: String) extends GADT2[_root_.scala.Array[_root_.scala.Byte]]
case class ReadBytes(path: String) extends GADT2[_root_.scala.Array[_root_.scala.Byte]]

case class CopyOver(src: Seq[_root_.scala.Byte], path: String) extends GADT2[Int]
case class CopyOver(src: Seq[_root_.scala.Byte], path: String) extends GADT2[Int]
}

verifySerDeser(make[Array[GADT2[_]]],
_root_.scala.Array[GADT2[_]](Exists("WWW"), ReadBytes("QQQ"), CopyOver("AAA".getBytes.toSeq, "OOO")),
_root_.scala.Array[GADT2[_]](GADT2.Exists("WWW"), GADT2.ReadBytes("QQQ"), GADT2.CopyOver("AAA".getBytes.toSeq, "OOO")),
"""[{"type":"Exists","path":"WWW"},{"type":"ReadBytes","path":"QQQ"},{"type":"CopyOver","src":[65,65,65],"path":"OOO"}]""")
}
"serialize and deserialize higher-kinded types" in {
Expand Down

0 comments on commit db52782

Please sign in to comment.