Skip to content

Commit db52782

Browse files
committed
A test that reproduces a bug which is reported in the #551 issue
1 parent 517c851 commit db52782

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

jsoniter-scala-macros/shared/src/test/scala/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMakerSpec.scala

+7-5
Original file line numberDiff line numberDiff line change
@@ -1878,16 +1878,18 @@ class JsonCodecMakerSpec extends VerifyingSpec {
18781878

18791879
sealed trait GADT2[A] extends Product with Serializable
18801880

1881-
case class IsDir(path: String) extends GADT2[_root_.scala.Boolean]
1881+
object GADT2 {
1882+
case class IsDir(path: String) extends GADT2[_root_.scala.Boolean]
18821883

1883-
case class Exists(path: String) extends GADT2[_root_.scala.Boolean]
1884+
case class Exists(path: String) extends GADT2[_root_.scala.Boolean]
18841885

1885-
case class ReadBytes(path: String) extends GADT2[_root_.scala.Array[_root_.scala.Byte]]
1886+
case class ReadBytes(path: String) extends GADT2[_root_.scala.Array[_root_.scala.Byte]]
18861887

1887-
case class CopyOver(src: Seq[_root_.scala.Byte], path: String) extends GADT2[Int]
1888+
case class CopyOver(src: Seq[_root_.scala.Byte], path: String) extends GADT2[Int]
1889+
}
18881890

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

0 commit comments

Comments
 (0)