aboutsummaryrefslogtreecommitdiff
path: root/tests/run/generic/Shapes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/generic/Shapes.scala')
-rw-r--r--tests/run/generic/Shapes.scala22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/run/generic/Shapes.scala b/tests/run/generic/Shapes.scala
new file mode 100644
index 000000000..8304551e3
--- /dev/null
+++ b/tests/run/generic/Shapes.scala
@@ -0,0 +1,22 @@
+package generic
+
+object Shapes {
+
+ trait Sum[+S1, +S2]
+ case class Fst[+F](x: F) extends Sum[F, Nothing]
+ case class Snd[+S](x: S) extends Sum[Nothing, S]
+
+ case class Prod[+P1, +P2](fst: P1, snd: P2)
+
+ case class Singleton[SI](value: SI)
+
+ case class EnumValue[E](tag: Int)
+
+ trait shaped[SH1, SH2] extends unfolds[SH1, SH2]
+
+ trait unfolds[UN1, UN2] {
+ def toShape(x: UN1): UN2
+ def fromShape(x: UN2): UN1
+ }
+}
+