diff options
Diffstat (limited to 'tests/pos')
-rw-r--r-- | tests/pos/enum-List-control.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/pos/enum-List-control.scala b/tests/pos/enum-List-control.scala new file mode 100644 index 000000000..d9df176d1 --- /dev/null +++ b/tests/pos/enum-List-control.scala @@ -0,0 +1,14 @@ +abstract sealed class List[T] extends Enum +object List { + final case class Cons[T](x: T, xs: List[T]) extends List[T] { + def enumTag = 0 + } + final case class Nil[T]() extends List[T] { + def enumTag = 1 + } +} +object Test { + import List._ + val xs = Cons(1, Cons(2, Cons(3, Nil()))) + def main(args: Array[String]) = println(xs) +} |