diff options
author | Jon Pretty <jon.pretty@propensive.com> | 2017-06-11 21:36:32 +0200 |
---|---|---|
committer | Jon Pretty <jon.pretty@propensive.com> | 2017-06-11 21:36:32 +0200 |
commit | 1ea072197cf8a992b37d7efe0636358a236b9d6d (patch) | |
tree | fed6804a2e65f783881ce1029bae60303b175803 /tests/shared/src/main/scala | |
parent | 9ff2305bcdd742529bd184ba90ecdef32ca2fe4d (diff) | |
download | magnolia-1ea072197cf8a992b37d7efe0636358a236b9d6d.tar.gz magnolia-1ea072197cf8a992b37d7efe0636358a236b9d6d.tar.bz2 magnolia-1ea072197cf8a992b37d7efe0636358a236b9d6d.zip |
Appears to be working for both covariant and contravariant typeclasses
Diffstat (limited to 'tests/shared/src/main/scala')
-rw-r--r-- | tests/shared/src/main/scala/magnolia/main.scala | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/shared/src/main/scala/magnolia/main.scala b/tests/shared/src/main/scala/magnolia/main.scala index 9c99d69..889757c 100644 --- a/tests/shared/src/main/scala/magnolia/main.scala +++ b/tests/shared/src/main/scala/magnolia/main.scala @@ -2,7 +2,7 @@ package magnolia sealed trait Tree -case class Branch(left: List[Leaf]) extends Tree +case class Branch(left: List[Twig]) extends Tree case class Leaf(node: List[String], right: List[Branch], left2: List[Branch], another: List[Leaf], broken: Double) extends Tree case class Twig(alpha: List[Twig], beta: List[Leaf], gamma: Double, delta: List[Tree]) extends Tree @@ -10,7 +10,9 @@ object Main { def main(args: Array[String]): Unit = { - println(implicitly[Extractor[List[Twig]]].extract(Thing("42"))) + + println(implicitly[Serializer[List[Tree]]].serialize(List(Branch(List(Twig(Nil, Nil, 43, Nil)))))) + println(implicitly[Extractor[List[Tree]]].extract(Thing("42"))) } } |