From 2be70e6019cff01d8a4bc40b90614c64d5d638ff Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 9 Feb 2017 22:49:19 +1100 Subject: Another test --- tests/run/enum-List3.check | 1 + tests/run/enum-List3.scala | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 tests/run/enum-List3.check create mode 100644 tests/run/enum-List3.scala (limited to 'tests/run') diff --git a/tests/run/enum-List3.check b/tests/run/enum-List3.check new file mode 100644 index 000000000..1d4812de1 --- /dev/null +++ b/tests/run/enum-List3.check @@ -0,0 +1 @@ +Cons(1,Cons(2,Cons(3,Nil))) diff --git a/tests/run/enum-List3.scala b/tests/run/enum-List3.scala new file mode 100644 index 000000000..e5ffe1a28 --- /dev/null +++ b/tests/run/enum-List3.scala @@ -0,0 +1,10 @@ +enum List[+T] { + case Cons(x: T, xs: List[T]) + case Nil extends List[Nothing] +} +object Test { + import List._ + val xs = Cons(1, Cons(2, Cons(3, Nil))) + def main(args: Array[String]) = println(xs) +} + -- cgit v1.2.3